From 0356349731dc70c61b533fb4bf914efde06d4b4f Mon Sep 17 00:00:00 2001 From: tleish Date: Mon, 18 Jul 2022 16:18:30 -0600 Subject: [PATCH] rebase cleanup --- src/tests/functional/form_submission_tests.ts | 1 - src/tests/functional/navigation_tests.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tests/functional/form_submission_tests.ts b/src/tests/functional/form_submission_tests.ts index 613fb24a6..009a9098d 100644 --- a/src/tests/functional/form_submission_tests.ts +++ b/src/tests/functional/form_submission_tests.ts @@ -146,7 +146,6 @@ test("test standard POST form submission events", async ({ page }) => { await nextEventNamed(page, "turbo:before-visit") await nextEventNamed(page, "turbo:visit") - await nextEventNamed(page, "turbo:before-cache") await nextEventNamed(page, "turbo:before-render") await nextEventNamed(page, "turbo:render") await nextEventNamed(page, "turbo:load") diff --git a/src/tests/functional/navigation_tests.ts b/src/tests/functional/navigation_tests.ts index cc39c1a10..dc2927cff 100644 --- a/src/tests/functional/navigation_tests.ts +++ b/src/tests/functional/navigation_tests.ts @@ -136,6 +136,19 @@ test("test following a same-origin POST form button[data-turbo-action=replace]", assert.equal(await visitAction(page), "replace") }) +test("test following a POST form clears cache", async({ page }) => { + await page.evaluate(() => { + const cachedElement = document.createElement("some-cached-element") + document.body.appendChild(cachedElement) + }) + + page.click("#form-post-submit") + await nextBeat // 301 redirect response + await nextBeat // 200 response + await page.goBack() + assert.notOk(await hasSelector(page, "some-cached-element")) +}) + test("test following a same-origin data-turbo=false link", async ({ page }) => { page.click("#same-origin-false-link") await nextBody(page)