Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
srt32 committed Jul 20, 2022
1 parent 4828df4 commit ecdd1c9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/tests/functional/frame_navigation_tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test } from "@playwright/test"
import { chromium, firefox } from "@playwright/test"
import { getFromLocalStorage, nextEventNamed, nextEventOnTarget, pathname } from "../helpers/page"
import { assert } from "chai"

Expand All @@ -24,6 +25,24 @@ test("test frame navigation with exterior link", async ({ page }) => {
await nextEventOnTarget(page, "frame", "turbo:frame-load")
})

test("test frame navigation emits fetch-error event when offline", async ({ page }) => {
let browser
if (process.env.browserName === "chromium") {
browser = await chromium.launch()
} else if (process.env.browserName === "firefox") {
browser = await firefox.launch()
} else {
throw new Error("unsupported browser")
}
const context = await browser.newContext()
page = await context.newPage()
await context.setOffline(true)
await page.goto("/src/tests/fixtures/tabs.html")
await page.click("#tab-2")
await nextEventOnTarget(page, "frame", "turbo:fetch-error")
await context.close()
})

test("test promoted frame navigation updates the URL before rendering", async ({ page }) => {
await page.goto("/src/tests/fixtures/tabs.html")

Expand Down

0 comments on commit ecdd1c9

Please sign in to comment.