Files
react-test/test/e2e-website/joy-docs.spec.ts
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

30 lines
922 B
TypeScript

import { test as base, expect } from '@playwright/test';
import { kebabCase } from 'es-toolkit/string';
import { TestFixture } from './playwright.config';
const test = base.extend<TestFixture>({});
test.describe('Joy docs', () => {
test('should have correct link with hash in the TOC', async ({ page }) => {
await page.goto('/joy-ui/getting-started/installation/');
const anchors = page.locator('[aria-label="Page table of contents"] ul a');
const firstAnchor = anchors.first();
const textContent = await firstAnchor.textContent();
await expect(firstAnchor).toHaveAttribute(
'href',
`/joy-ui/getting-started/installation/#${kebabCase(textContent || '')}`,
);
});
test('should be able to see demos', async ({ page }) => {
await page.goto('/joy-ui/react-button/');
const headline = page.locator('main h1');
await expect(headline).toHaveText('Button');
});
});