Skip to content

Commit 842a39d

Browse files
Merge fix
1 parent ae89d54 commit 842a39d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/test-team/fixtures/accessibility-analyze.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { expect } from '@playwright/test';
66
type Analyze = <T extends TemplateMgmtBasePage>(
77
page: T,
88
opts?: {
9-
id?: string;
9+
ids?: string[];
1010
beforeAnalyze?: (page: T) => Promise<void>;
1111
}
1212
) => Promise<void>;
@@ -30,20 +30,23 @@ const makeAxeBuilder = (page: Page) =>
3030
export const test = base.extend<AccessibilityFixture>({
3131
analyze: async ({ baseURL, page }, use) => {
3232
const analyze: Analyze = async (pageUnderTest, opts) => {
33-
const { id, beforeAnalyze } = opts ?? {};
33+
const { ids, beforeAnalyze } = opts ?? {};
3434

35-
await pageUnderTest.loadPage(id);
35+
await pageUnderTest.loadPage(...(ids ?? []));
3636

3737
if (beforeAnalyze) {
3838
await beforeAnalyze(pageUnderTest);
3939
}
4040

41-
const pageUrlSegment = (
41+
const pageUrlSegments = (
4242
pageUnderTest.constructor as typeof TemplateMgmtBasePage
43-
).pageUrlSegment;
43+
).pageUrlSegments;
4444

4545
await expect(page).toHaveURL(
46-
new RegExp(`${baseURL}/templates/${pageUrlSegment}(.*)`) // eslint-disable-line security/detect-non-literal-regexp
46+
// eslint-disable-next-line security/detect-non-literal-regexp
47+
new RegExp(
48+
`${baseURL}/templates/${pageUrlSegments.join('/[^/]+/')}(.*)`
49+
)
4750
);
4851

4952
const results = await makeAxeBuilder(page).analyze();

tests/test-team/template-mgmt-accessibility/routing.accessibility.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test.describe('Routing - Accessibility', () => {
9494

9595
test('Choose template', async ({ page, analyze }) =>
9696
analyze(new RoutingChooseTemplatesPage(page), {
97-
id: validRoutingConfigId,
97+
ids: [validRoutingConfigId],
9898
}));
9999

100100
test('Choose message order - error', async ({ page, analyze }) =>

0 commit comments

Comments
 (0)