Fix: Intro re-load
CI / regression (push) Successful in 1m28s

This commit is contained in:
Zakaria
2026-06-06 00:26:56 -04:00
parent 9edaa3e351
commit 84ba3c92b7
4 changed files with 43 additions and 3 deletions
+15 -1
View File
@@ -17,6 +17,12 @@ async function skipIntro(page) {
await expect(page.locator("[data-key]")).toHaveCount(26)
}
async function expectGameReadyWithoutIntro(page) {
await expect(page.locator("#intro-overlay")).toBeHidden()
await expect(page.locator("[data-guess-grid] .tile")).toHaveCount(30)
await expect(page.locator("[data-key]")).toHaveCount(26)
}
test("loads the intro and reveals the game board", async ({ page }) => {
await openApp(page)
@@ -36,10 +42,18 @@ test("uses dark mode by default and preserves a light preference", async ({ page
await expect(page.locator("#theme-button")).toHaveAttribute("aria-label", "Switch to dark mode")
await page.reload()
await skipIntro(page)
await expectGameReadyWithoutIntro(page)
await expect(page.locator("body")).not.toHaveClass(/dark-theme/)
})
test("does not replay the intro after a same-tab reload", async ({ page }) => {
await openApp(page)
await skipIntro(page)
await page.reload()
await expectGameReadyWithoutIntro(page)
})
test("pressing Enter after changing theme does not re-trigger the theme button", async ({ page }) => {
await openApp(page)
await skipIntro(page)