Skip to content

Commit

Permalink
Add failing visit advance test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexspeller committed Jan 22, 2024
1 parent 52db399 commit 4765233
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tests/functional/frame_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,17 @@ test("navigating turbo-frame[data-turbo-action=advance] with Turbo.visit pushes
expect(pathname(page.url())).toEqual(path)
})

test("navigating turbo-frame without advance with Turbo.visit specifying advance pushes URL state", async ({ page }) => {
const path = "/src/tests/fixtures/frames/frame.html"

await page.evaluate((path) => window.Turbo.visit(path, { frame: "frame", action: "advance" }), path)
await nextEventNamed(page, "turbo:load")

await expect(page.locator("h1")).toHaveText("Frames")
await expect(page.locator("#frame h2")).toHaveText("Frame: Loaded")
expect(pathname(page.url())).toEqual(path)
})

test("navigating turbo-frame[data-turbo-action=advance] to the same URL clears the [aria-busy] and [data-turbo-preview] state", async ({
page
}) => {
Expand Down

0 comments on commit 4765233

Please sign in to comment.