Skip to content

Commit d6d7498

Browse files
committed
test(desktop): require semantic profile hover endpoint
Resolve the hover token and reject transparency before comparing profile and channel surfaces. Keep the original exact profile equality and the Bestie closed-drag precondition unchanged. Signed-off-by: Logan Johnson <[email protected]>
1 parent ee67e59 commit d6d7498

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎desktop/tests/e2e/message-feedback-snapshots.spec.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,20 @@ test("profile hover uses the channel hover surface", async ({ page }) => {
100100

101101
const profile = page.getByTestId("sidebar-profile-card");
102102
const channel = page.getByTestId("channel-random");
103+
const hoverSurface = await channel.evaluate((element) => {
104+
const probe = document.createElement("span");
105+
probe.style.backgroundColor = "var(--buzz-hover-surface)";
106+
element.append(probe);
107+
const color = getComputedStyle(probe).backgroundColor;
108+
probe.remove();
109+
return color;
110+
});
111+
// Equal unfinished (transparent) surfaces must not satisfy hover parity.
112+
expect(hoverSurface).not.toMatch(/^(transparent|rgba\(.*,\s*0\))$/);
103113
await channel.hover();
104-
// Wait for the CSS transition to settle before capturing the hover color so
105-
// a mid-transition sample does not produce a value the profile card (which
106-
// uses the same token) can never match.
107-
await waitForAnimations(page);
114+
// Observe the semantic endpoint, not an intermediate transition sample or
115+
// the shared animation helper's timeout-as-success ceiling.
116+
await expect(channel).toHaveCSS("background-color", hoverSurface);
108117
const channelHoverColor = await channel.evaluate(
109118
(element) => getComputedStyle(element).backgroundColor,
110119
);

0 commit comments

Comments
 (0)