Skip to content

Commit

Permalink
fix hotwired#1241 - adding failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tleish committed Jun 21, 2024
1 parent c339144 commit 53e8583
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/tests/functional/frame_navigation_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check failure on line 46 in src/tests/functional/frame_navigation_tests.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
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 }) => {
Expand Down Expand Up @@ -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]")
})

0 comments on commit 53e8583

Please sign in to comment.