diff --git a/src/core/drive/visit.ts b/src/core/drive/visit.ts index ec2efda92..1a311b640 100644 --- a/src/core/drive/visit.ts +++ b/src/core/drive/visit.ts @@ -202,6 +202,7 @@ export class Visit implements FetchRequestDelegate { if (this.state == VisitState.started) { this.state = VisitState.failed this.adapter.visitFailed(this) + this.delegate.visitCompleted(this) } } diff --git a/src/tests/functional/rendering_tests.ts b/src/tests/functional/rendering_tests.ts index a621191d8..bb8e33885 100644 --- a/src/tests/functional/rendering_tests.ts +++ b/src/tests/functional/rendering_tests.ts @@ -46,7 +46,7 @@ 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") @@ -54,6 +54,8 @@ test("test triggers before-render and render events for error pages", async ({ p 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 }) => {