@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user