Fix definition request timeout
CI / regression (push) Successful in 1m56s

This commit is contained in:
Zakaria
2026-09-22 07:59:30 -04:00
parent a6f3ef8c82
commit e4d0d3b55c
2 changed files with 31 additions and 13 deletions
+16
View File
@@ -100,3 +100,19 @@ test("stats and leaderboard modals open", async ({ page }) => {
await page.locator("#leaderboard-button").click()
await expect(page.locator("#leaderboard-modal")).toBeVisible()
})
test("definition lookup leaves loading state when a provider times out", async ({ page }) => {
await page.route("https://api.dictionaryapi.dev/**", () => new Promise(() => {}))
await page.route("https://en.wiktionary.org/**", route => route.abort())
await openApp(page)
await skipIntro(page)
await page.evaluate(() => {
lastResult = { won: true, guesses: 1, word: "apple" }
loadWordDefinition("apple", true)
})
await expect(page.locator("#stats-definition")).toContainText("Definition not available at the moment.", {
timeout: 6500
})
})