This commit is contained in:
@@ -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
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user