From 53e85832b5eb69584294c97478bc26b1fd9eee27 Mon Sep 17 00:00:00 2001 From: tleish Date: Fri, 21 Jun 2024 07:37:51 -1000 Subject: [PATCH] fix #1241 - adding failing tests --- src/tests/functional/frame_navigation_tests.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tests/functional/frame_navigation_tests.js b/src/tests/functional/frame_navigation_tests.js index 9927aec87..85e1c7191 100644 --- a/src/tests/functional/frame_navigation_tests.js +++ b/src/tests/functional/frame_navigation_tests.js @@ -36,12 +36,19 @@ test("frame navigation with data-turbo-action", async ({ page }) => { await nextBeat() await nextEventOnTarget(page, "empty-head", "turbo:frame-load") + assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/empty_head.html") - const frameText = await page.textContent("#empty-head h2") + let frameText = await page.textContent("#empty-head h2") assert.equal(frameText, "Frame updated") const titleText = await page.textContent("h1") assert.equal(titleText, "Frame navigation tests") + + await page.goBack() + await nextEventNamed(page, "turbo:load") + assert.equal(pathname(page.url()), "/src/tests/fixtures/frame_navigation.html") + frameText = await page.textContent("#empty-head #link-to-frame-with-empty-head") + assert.equal(frameText, 'About (a link with data-turbo-action="advance")') }) test("frame navigation emits fetch-request-error event when offline", async ({ page }) => { @@ -111,10 +118,7 @@ test("promoted frame navigations are cached", async ({ page }) => { assert.equal(pathname((await page.getAttribute("#tab-frame", "src")) || ""), "/src/tests/fixtures/tabs/two.html") assert.equal(await page.getAttribute("#tab-frame", "complete"), "", "caches two.html with [complete]") - await page.goBack() - await nextEventNamed(page, "turbo:load") - assert.equal(await page.textContent("#tab-content"), "One") assert.equal(await page.getAttribute("#tab-frame", "src"), null, "caches one.html without #tab-frame[src]") assert.equal(await page.getAttribute("#tab-frame", "complete"), null, "caches one.html without [complete]") })