Skip to content

Commit b993255

Browse files
authored
test(core): the menu drag pixel proof waits for the menu's entrance (#10638)
test(core): the menu drag pixel proof waits for the menu's entrance The proof read the menu's box and sampled its first pixel as soon as a row was attached, while the entrance on the menu's surface still ran. The box then sat a few pixels above its rest place, so the sample could land on the surface's top edge, or on the trigger behind a surface that was still transparent. The proof now waits with the harness's waitForRest on the menu's layer before it reads the box.
1 parent e072916 commit b993255

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/core/src/__tests__/PressModality.a11y.chromium.spec.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
serveStorybook,
3434
type StaticServer,
3535
} from '@astryxdesign/a11y-spec/storybook';
36+
import {waitForRest} from '@astryxdesign/interaction-harness';
3637

3738
let storybook: StaticServer;
3839

@@ -330,6 +331,10 @@ test('a mouse press dragged across menu rows lights only the row under the point
330331
).toBe(true);
331332
const rows = page.getByRole('menuitem');
332333
await rows.first().waitFor();
334+
// The menu's box and its paint are read once its entrance has ended.
335+
await waitForRest(
336+
page.locator('[popover]:has([data-astryx-menu-press])').first(),
337+
);
333338
const menu = await page.locator('[data-astryx-menu-press]').boundingBox();
334339
const first = await rows.nth(0).boundingBox();
335340
const second = await rows.nth(1).boundingBox();

0 commit comments

Comments
 (0)