An open source design system that's fully customizable and agent ready
TypeScript
test(TreeList): the tree-view coverage check runs as one serial part per state (#9004)
Cindy Zhang4c07cbb94f57
diff --git a/packages/core/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts b/packages/core/src/TreeList/__tests__/TreeList.a11y.chromium.spec.tsindex 3e21e61424..d4e46ecd53 100644--- a/packages/core/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts+++ b/packages/core/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts@@ -98,15 +98,27 @@ async function runState(});}-test('every tree-view expectation is exercised by a TreeList state', async ({- page,-}) => {- const cdp = await page.context().newCDPSession(page);+// Checking coverage runs every state again, which on a loaded runner nears+// 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('every tree-view expectation is exercised by a TreeList state', () => {+ test.describe.configure({mode: 'serial'});const results: BindingResult[] = [];+for (const state of TREE_LIST_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(neverExercised(results)).toEqual([]);++ test('no expectation is left unexercised', () => {+ // Every part ran in this worker; this test alone proves nothing.+ expect(results.map(result => result.state).sort()).toEqual(+ TREE_LIST_BINDING_STATES.map(state => state.id).sort(),+ );+ expect(neverExercised(results)).toEqual([]);+ });});for (const state of TREE_LIST_BINDING_STATES) {