Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(Banner): run the known-failure check as one part per alert state (#10412)

Christopher Chedeau91150ccc6e2a
diff --git a/packages/core/src/Banner/__tests__/Alert.a11y.chromium.spec.ts b/packages/core/src/Banner/__tests__/Alert.a11y.chromium.spec.ts
index 4df3b06d5b..6c570d57e4 100644
--- a/packages/core/src/Banner/__tests__/Alert.a11y.chromium.spec.ts
+++ b/packages/core/src/Banner/__tests__/Alert.a11y.chromium.spec.ts
@@ -116,17 +116,29 @@ async function runState(
});
}
-test('all Banner alert states have no unmatched known failure', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking known failures runs every state again, which on a loaded runner
+// passes the per-test timeout as one test. It runs as one serial part per
+// state, sharing their results, then one check over all of them.
+test.describe('all Banner alert states have no unmatched known failure', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of BANNER_ALERT_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(unmatchedKnownFailures(BANNER_ALERT_KNOWN_FAILURES, results)).toEqual(
- [],
- );
+
+ test('no known failure is unmatched', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ BANNER_ALERT_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(
+ unmatchedKnownFailures(BANNER_ALERT_KNOWN_FAILURES, results),
+ ).toEqual([]);
+ });
});
for (const state of BANNER_ALERT_BINDING_STATES) {