From 35fed6dc85664c153eb76a404b4bbf6081191040 Mon Sep 17 00:00:00 2001 From: Nicholas Petrasek Date: Wed, 9 Sep 2026 12:55:48 +0200 Subject: [PATCH 1/2] test(docs): synchronize preview hydration and morph sampling --- e2e/website/recipes.spec.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/e2e/website/recipes.spec.ts b/e2e/website/recipes.spec.ts index 312a7948..67fb7245 100644 --- a/e2e/website/recipes.spec.ts +++ b/e2e/website/recipes.spec.ts @@ -418,7 +418,9 @@ test('device lab interrupts a morph from its live geometry without replacing the }) await page.getByRole('button', { name: 'Landscape' }).click() await expect(frame).toHaveAttribute('data-morphing', 'true') - await setAnimationsAt(90, false) + // Sample a fixed intermediate presentation so elapsed animation time cannot + // look like a discontinuity across the synchronous click handler. + await setAnimationsAt(90, true) let releaseNavigation = () => {} let markNavigationBlocked = () => {} @@ -1207,6 +1209,10 @@ test( async ({ page }) => { await page.emulateMedia({ reducedMotion: 'reduce' }) await page.goto('/examples/reduced-motion/') + await expect(page.locator('.docs-device-frame')).toHaveAttribute( + 'data-preview-ready', + 'true', + ) const frame = recipeFrame(page) const trigger = frame.getByRole('button', { name: 'Open reduced-motion sheet', @@ -1688,6 +1694,10 @@ test( async ({ page }) => { await page.setViewportSize({ width: 1440, height: 900 }) await page.goto('/examples/basic/?device=phone&orientation=portrait') + await expect(page.locator('.docs-device-frame')).toHaveAttribute( + 'data-preview-ready', + 'true', + ) const iframe = page.locator('[title$="interactive preview"]') const iframeElement = await iframe.elementHandle() expect(iframeElement).not.toBeNull() From ee71d92c9c92647531444fbea8a7daffd566a3e1 Mon Sep 17 00:00:00 2001 From: Nicholas Petrasek Date: Wed, 9 Sep 2026 12:56:58 +0200 Subject: [PATCH 2/2] test(docs): retain interrupted morph freeze coverage --- e2e/website/recipes.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/e2e/website/recipes.spec.ts b/e2e/website/recipes.spec.ts index 67fb7245..0fec7e6b 100644 --- a/e2e/website/recipes.spec.ts +++ b/e2e/website/recipes.spec.ts @@ -509,6 +509,13 @@ test('device lab interrupts a morph from its live geometry without replacing the await page.getByRole('button', { name: 'Tablet' }).dispatchEvent('click') await navigationBlocked + // Correct hold animations remain still when played; an uncancelled original + // morph must advance so the stability assertion below can catch it. + await page.locator('.docs-device-lab').evaluate(async (element) => { + const animations = element.getAnimations({ subtree: true }) + for (const animation of animations) animation.play() + await Promise.all(animations.map((animation) => animation.ready)) + }) await page.waitForTimeout(80) const heldPresentation = await readGeometry() const blockedPresentation = await page.evaluate(() => {