Skip to content

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

TypeScript

test(List): the press release curve proof holds the release in the page (#10047)

Christopher Chedeau922c0e85d6d9
diff --git a/packages/core/src/List/__tests__/ListRowPress.interaction.browser.spec.ts b/packages/core/src/List/__tests__/ListRowPress.interaction.browser.spec.ts
index ec99e5dfcf..08ec9cec7f 100644
--- a/packages/core/src/List/__tests__/ListRowPress.interaction.browser.spec.ts
+++ b/packages/core/src/List/__tests__/ListRowPress.interaction.browser.spec.ts
@@ -33,13 +33,13 @@ import {
} from '@astryxdesign/a11y-spec/playwright';
import {
animationStoryboard,
+ armHold,
blockMainThread,
castStoryboard,
compareCurve,
countBetween,
cubicBezier,
freezeTimers,
- holdAnimations,
installLongTaskLog,
installTimerGate,
openStory,
@@ -254,10 +254,14 @@ test('a held row paints the pressed token and its release follows the exit easin
// the release clock (after which the release ends with its animation) can
// be held while the release is seeked.
await installTimerGate(page);
+ // The page holds the release itself as soon as it runs. A hold the test
+ // sends after the lift arrives later on a busy machine, and the release
+ // can end first.
+ const hold = await armHold(page, row);
await driver.play(tap(center, {holdMs: HOLD_MS}));
expect(await pressState(row)).toBe('fading');
await freezeTimers(page);
- const held = await holdAnimations(page, row);
+ const held = await hold.held();
const release = held.find(
a => a.target?.startsWith('li') && a.kind === 'CSSAnimation',
);