Skip to content

Commit

Permalink
Test turbo:load dispatched on error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
domchristie committed Aug 24, 2023
1 parent f2a7899 commit 9d5a20c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tests/functional/rendering_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ test("test includes isPreview in render event details", async ({ page }) => {
assert.equal(await isPreview, false)
})

test("test triggers before-render and render events for error pages", async ({ page }) => {
test("test triggers before-render, render, and load events for error pages", async ({ page }) => {
await page.click("#nonexistent-link")
const { newBody } = await nextEventNamed(page, "turbo:before-render")

assert.equal(await textContent(page, newBody), "\nCannot GET /nonexistent\n\n\n")

await nextEventNamed(page, "turbo:render")
assert.equal(await newBody, await page.evaluate(() => document.body.outerHTML))

await nextEventNamed(page, "turbo:load")
})

test("test reloads when tracked elements change", async ({ page }) => {
Expand Down

0 comments on commit 9d5a20c

Please sign in to comment.