Skip to content

Commit 53e8583

Browse files
committed
fix hotwired#1241 - adding failing tests
1 parent c339144 commit 53e8583

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/tests/functional/frame_navigation_tests.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ test("frame navigation with data-turbo-action", async ({ page }) => {
3636
await nextBeat()
3737

3838
await nextEventOnTarget(page, "empty-head", "turbo:frame-load")
39+
assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/empty_head.html")
3940

40-
const frameText = await page.textContent("#empty-head h2")
41+
let frameText = await page.textContent("#empty-head h2")
4142
assert.equal(frameText, "Frame updated")
4243

4344
const titleText = await page.textContent("h1")
4445
assert.equal(titleText, "Frame navigation tests")
46+
47+
await page.goBack()
48+
await nextEventNamed(page, "turbo:load")
49+
assert.equal(pathname(page.url()), "/src/tests/fixtures/frame_navigation.html")
50+
frameText = await page.textContent("#empty-head #link-to-frame-with-empty-head")
51+
assert.equal(frameText, 'About (a link with data-turbo-action="advance")')
4552
})
4653

4754
test("frame navigation emits fetch-request-error event when offline", async ({ page }) => {
@@ -111,10 +118,7 @@ test("promoted frame navigations are cached", async ({ page }) => {
111118
assert.equal(pathname((await page.getAttribute("#tab-frame", "src")) || ""), "/src/tests/fixtures/tabs/two.html")
112119
assert.equal(await page.getAttribute("#tab-frame", "complete"), "", "caches two.html with [complete]")
113120

114-
await page.goBack()
115-
await nextEventNamed(page, "turbo:load")
116121

117-
assert.equal(await page.textContent("#tab-content"), "One")
118122
assert.equal(await page.getAttribute("#tab-frame", "src"), null, "caches one.html without #tab-frame[src]")
119123
assert.equal(await page.getAttribute("#tab-frame", "complete"), null, "caches one.html without [complete]")
120124
})

0 commit comments

Comments
 (0)