Skip to content

Commit

Permalink
rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tleish committed Jul 18, 2022
1 parent 57c3ef3 commit 0356349
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/tests/functional/form_submission_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 13 additions & 0 deletions src/tests/functional/navigation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0356349

Please sign in to comment.