Skip to content

Commit

Permalink
Rewrite test fix to use playwright API
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Aug 30, 2024
1 parent fceb2cb commit 3af219d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/tests/functional/page_refresh_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,9 @@ test("uses morphing to only update remote frames marked with refresh='morph'", a
test("don't refresh frames contained in [data-turbo-permanent] elements", async ({ page }) => {
await page.goto("/src/tests/fixtures/page_refresh.html")

await page.evaluate(() => {
const frame = document.getElementById("remote-permanent-frame");
if (frame) {
frame.textContent = "Frame to be preserved"
}
}) // The final assertion cannot be noNextEventOnTarget because the assertion passes even when it reloads the frame.
// Set the frame's text since the final assertion cannot be noNextEventOnTarget as that is passing even when the frame reloads.
const frame = page.locator("#remote-permanent-frame")
await frame.evaluate((frame) => frame.textContent = "Frame to be preserved")

await page.click("#form-submit")
await nextEventNamed(page, "turbo:render", { renderMethod: "morph" })
Expand Down

0 comments on commit 3af219d

Please sign in to comment.