From 3ad41344546af2c502575c7ec5f106cf5502a2b6 Mon Sep 17 00:00:00 2001 From: Adrien Siami Date: Wed, 7 Feb 2024 14:03:49 +0100 Subject: [PATCH] Try to fix progress bar persisting when following a redirect --- src/core/drive/visit.js | 2 +- src/tests/functional/navigation_tests.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/drive/visit.js b/src/core/drive/visit.js index 3adad253c..ec7565979 100644 --- a/src/core/drive/visit.js +++ b/src/core/drive/visit.js @@ -136,11 +136,11 @@ export class Visit { complete() { if (this.state == VisitState.started) { this.recordTimingMetric(TimingMetric.visitEnd) + this.adapter.visitCompleted(this) this.state = VisitState.completed this.followRedirect() if (!this.followedRedirect) { - this.adapter.visitCompleted(this) this.delegate.visitCompleted(this) } } diff --git a/src/tests/functional/navigation_tests.js b/src/tests/functional/navigation_tests.js index cdbc90e22..e1aa7e757 100644 --- a/src/tests/functional/navigation_tests.js +++ b/src/tests/functional/navigation_tests.js @@ -379,6 +379,7 @@ test("following a redirection", async ({ page }) => { await nextBody(page) assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html") assert.equal(await visitAction(page), "replace") + await waitUntilNoSelector(page, ".turbo-progress-bar") }) test("clicking the back button after redirection", async ({ page }) => {