Skip to content

Commit 8e7487a

Browse files
committed
fix: setup the long transition
1 parent 1db1e75 commit 8e7487a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎webview-ui/src/components/ui/__tests__/VisualTheme.visual.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ test("finishes theme color transitions before contrast checks read them", async
77
const action = component.getByRole("button", { name: /provider/i }).first()
88
await expect(action).toBeVisible()
99

10+
// Stretch the about 150 ms transition so it cannot end on its own before the assertions read it.
11+
// Reading the computed style flushes it, so the theme switch below starts the long transition.
12+
const transitionDuration = await action.evaluate((element) => {
13+
element.style.transitionDuration = "10s"
14+
return getComputedStyle(element).transitionDuration
15+
})
16+
expect(transitionDuration).toBe("10s")
17+
1018
// The gallery starts in the dark theme, so this switch starts the Button border-color transition.
1119
await applyVisualTheme(
1220
page,

0 commit comments

Comments
 (0)