mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
test(e2e): identify counter without the flaky hover tooltip
getNamedClickCounter hovered the counter button and waited for its matTooltip title, but matTooltip does not open on Playwright's synthetic hover in headless CI — the assertion timed out at PHASE 1 before the gate logic ran (run 29098937743, SuperSync 1/6). Each client has exactly one counter at every interaction point here, so assert the button's rendered initial instead of hovering for a tooltip.
This commit is contained in:
parent
eecf33a4e8
commit
a09ef864cf
1 changed files with 10 additions and 4 deletions
|
|
@ -75,10 +75,16 @@ const getNamedClickCounter = async (
|
|||
.last();
|
||||
await counter.waitFor({ state: 'visible', timeout: 15000 });
|
||||
|
||||
// Counter buttons render only their initial, so verify the exact counter via
|
||||
// its accessible Material tooltip before interacting with it.
|
||||
await counter.hover();
|
||||
await expect(client.page.getByRole('tooltip').filter({ hasText: title })).toBeVisible();
|
||||
// The button renders only the title's initial; the full title lives in a
|
||||
// matTooltip that does NOT open on Playwright's synthetic hover in headless
|
||||
// CI, so we can't identify by tooltip. This test only ever has one counter
|
||||
// per client at each interaction point (A imports after its only counter
|
||||
// interaction; B keeps local via USE_LOCAL and never adopts the backup's
|
||||
// counters), so the last button is unambiguous — sanity-check its rendered
|
||||
// initial matches the expected title instead of hovering for a tooltip.
|
||||
await expect(counter.locator('.habit-initial')).toHaveText(
|
||||
title.charAt(0).toUpperCase(),
|
||||
);
|
||||
return counter;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue