From 5ba140eb25c373e56e1ee28560bff56b47bc284f Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Thu, 29 Oct 2026 03:58:16 +0100 Subject: [PATCH] test: read the TopBar trigger look once the hover transition is done transition-colors also runs with reduced motion, so the border colour read right after hover() was sometimes a value in between and the comparison failed now and then. Signed-off-by: Florian Laabs --- packages/parity/e2e/topbar.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/parity/e2e/topbar.spec.ts b/packages/parity/e2e/topbar.spec.ts index adb80fd..5cae923 100644 --- a/packages/parity/e2e/topbar.spec.ts +++ b/packages/parity/e2e/topbar.spec.ts @@ -1,9 +1,11 @@ import { expect, test, type Locator } from '@playwright/test'; import { openStory } from './story.ts'; -/** What sets two triggers in a bar apart: size, border and a ring (box-shadow) */ +/** What sets two triggers in a bar apart: size, border and a ring (box-shadow) – once the hover transition is done */ const look = (element: Locator) => - element.evaluate((node) => { + element.evaluate(async (node) => { + // transition-colors runs also with reduced motion: a value read in between differs from run to run + await Promise.all(node.getAnimations().map((animation) => animation.finished)); const style = getComputedStyle(node); return { size: `${style.width} × ${style.height}`,