Skip to content

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

TypeScript

test(Lightbox): the cancel's busy proof blocks as the return starts (#10761)

Christopher Chedeaub77be44be222
diff --git a/packages/core/src/Lightbox/__tests__/LightboxDismissCancel.interaction.browser.spec.ts b/packages/core/src/Lightbox/__tests__/LightboxDismissCancel.interaction.browser.spec.ts
index 9fdd8b15d6..b7ccf45d0a 100644
--- a/packages/core/src/Lightbox/__tests__/LightboxDismissCancel.interaction.browser.spec.ts
+++ b/packages/core/src/Lightbox/__tests__/LightboxDismissCancel.interaction.browser.spec.ts
@@ -443,15 +443,17 @@ test('the cancel keeps moving every frame while the main thread is blocked', asy
// compositor presented while the main thread spun, on this machine.
await startBusyControl(page);
const cast = await startScreencast(page);
- // Pulled 300 px, so the return is long enough to judge on a loaded runner.
- await v.driver.play(pullThenFlickUp(v.centre, 300, 60));
// Blocked inside the page once the return runs on the compositor, 16 ms in,
- // as the dismissal's proof is. A block started from the test lands later in
- // the return, by a varying amount, and leaves less of it to judge.
- const block = await blockMainThread(page, 600, {
+ // as the dismissal's proof is. The page already waits when the lift starts
+ // the return. A block asked for after the drag's script returns lands later
+ // in the return on a busy machine, and leaves less of it to judge.
+ const blocking = blockMainThread(page, 600, {
during: v.photo,
minProgressMs: 16,
});
+ // Pulled 300 px, so the return is long enough to judge on a loaded runner.
+ await v.driver.play(pullThenFlickUp(v.centre, 300, 60));
+ const block = await blocking;
// A few frames after the block, so the screencast holds its end.
await frames(page, 6);
const castFrames = await cast.stop();