* feat: Rename assistantId to agentId * feat: Allow reading default facet values from index searchParameters * feat: Remove indexName prop from Sidepanel, cleanup documentation pages * feat: Move appId and apiKey up into @docsearch/core * feat: Add back nested grouping of search results * add changeset * revert changes to example demo * fix: e2e tests
71 lines
2 KiB
TypeScript
71 lines
2 KiB
TypeScript
import { test, expect, gatherA11yViolations } from './fixtures';
|
|
|
|
test.describe('a11y > Modal', () => {
|
|
test.beforeEach(async ({ docSearch }) => {
|
|
await docSearch.goto();
|
|
await docSearch.waitForLoad();
|
|
});
|
|
|
|
test('Smoke test', async ({ docSearch, axe }, testInfo) => {
|
|
await docSearch.openModal();
|
|
|
|
const scanResults = await axe().include('.DocSearch-Container').analyze();
|
|
|
|
await testInfo.attach('a11y-scan-results-modal', {
|
|
body: JSON.stringify(scanResults.violations, null, 2),
|
|
contentType: 'application/json',
|
|
});
|
|
|
|
// 6 is the current number of reported violations
|
|
expect(
|
|
gatherA11yViolations(scanResults.violations).length
|
|
).toBeLessThanOrEqual(6);
|
|
});
|
|
|
|
test('Search results', async ({ docSearch, axe }, testInfo) => {
|
|
await docSearch.openModal();
|
|
|
|
await docSearch.typeQueryMatching();
|
|
|
|
await expect(docSearch.hits).toBeVisible();
|
|
|
|
const scanResults = await axe()
|
|
.include('#docsearch-hits_docsearch_0-list')
|
|
.analyze();
|
|
|
|
await testInfo.attach('a11y-scan-results-modal-search-results', {
|
|
body: JSON.stringify(scanResults.violations, null, 2),
|
|
contentType: 'application/json',
|
|
});
|
|
|
|
// 24 is the current number of reported violations
|
|
expect(
|
|
gatherA11yViolations(scanResults.violations).length
|
|
).toBeLessThanOrEqual(24);
|
|
});
|
|
});
|
|
|
|
test.describe('a11y > Sidepanel', () => {
|
|
test.beforeEach(async ({ docSearch, sidepanel }) => {
|
|
await docSearch.goto();
|
|
await sidepanel.waitForLoad();
|
|
});
|
|
|
|
test('Smoke test', async ({ sidepanel, axe }, testInfo) => {
|
|
await sidepanel.openSidepanel();
|
|
|
|
const scanResults = await axe()
|
|
.include('.DocSearch-Sidepanel-Container')
|
|
.analyze();
|
|
|
|
await testInfo.attach('a11y-scan-results-sidepanel', {
|
|
body: JSON.stringify(scanResults.violations, null, 2),
|
|
contentType: 'application/json',
|
|
});
|
|
|
|
// 4 is the current number of reported violations
|
|
expect(
|
|
gatherA11yViolations(scanResults.violations).length
|
|
).toBeLessThanOrEqual(4);
|
|
});
|
|
});
|