mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(e2e): make the pin-tools spec idempotent across retries (#697)
The nightly E2E Full (4/4) intermittently failed pin-tools at its opening no-Pinned-section assertion: the spec mutates the shared pinnedTools preference, and with CI retries:1 an attempt that failed after pinning left a server-side pin the retry saw. Reset pinnedTools via the preferences API at the start so the test is idempotent. Confirmed intermittent (the same job passed on rerun of unchanged code) and PR CI green.
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { expect, test } from "./helpers";
|
||||
import { expect, putPreferences, test } from "./helpers";
|
||||
|
||||
// Mutates the shared per-user `pinnedTools` preference on the server, so it
|
||||
// pins and then unpins within the single test to leave state clean.
|
||||
test.describe("Pin tools", () => {
|
||||
test("pin a tool, persist across reload, then unpin", async ({ loggedInPage: page }) => {
|
||||
// Start from a known-empty pin state. CI retries once, and a prior attempt
|
||||
// that failed after pinning but before unpinning leaves a server-side pin,
|
||||
// which would fail the "not pinned yet" assertion below on the retry.
|
||||
expect((await putPreferences(page, { pinnedTools: [] })).ok).toBeTruthy();
|
||||
await page.reload();
|
||||
|
||||
// Resize lives under Image > Essentials on the All tab (default).
|
||||
const pinToggle = page.getByTestId("pin-toggle-resize").first();
|
||||
await expect(pinToggle).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user