From 47652337590c215697cdc92764fbc8c8c780eaaa Mon Sep 17 00:00:00 2001 From: Alex Speller <1217+alexspeller@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:54:22 -0100 Subject: [PATCH] Add failing visit advance test --- src/tests/functional/frame_tests.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tests/functional/frame_tests.js b/src/tests/functional/frame_tests.js index 530e18383..f1925908b 100644 --- a/src/tests/functional/frame_tests.js +++ b/src/tests/functional/frame_tests.js @@ -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 }) => {