Skip to content

Commit

Permalink
make tests consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Feb 19, 2024
1 parent 51b4d6e commit e429db7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/tests/functional/frame_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ test("following a link within a frame with a target set navigates the target fra
await nextBeat()

expect(await noNextEventOnTarget(page, "frame", "turbo:before-frame-morph")).toBeTruthy()
const frameText = await page.textContent("#frame h2")
assert.equal(frameText, "Frame: Loaded")
await expect(page.locator("#frame h2")).toHaveText("Frame: Loaded")
})

test("following a link within a frame with a target set navigates the target frame[refresh=morph] with a morph", async ({ page }) => {
Expand All @@ -282,17 +281,15 @@ test("following a link within a frame with a target set navigates the target fra
await nextBeat()

expect(await nextEventOnTarget(page, "frame", "turbo:before-frame-morph")).toBeTruthy()
const frameText = await page.textContent("#frame h2")
assert.equal(frameText, "Frame: Loaded")
await expect(page.locator("#frame h2")).toHaveText("Frame: Loaded")
})

test("navigating turbo-frame from within replaces the contents", async ({ page }) => {
await page.click("#link-frame")
await nextBeat()

expect(await noNextEventOnTarget(page, "frame", "turbo:before-frame-morph")).toBeTruthy()
const frameText = await page.textContent("#frame h2")
assert.equal(frameText, "Frame: Loaded")
await expect(page.locator("#frame h2")).toHaveText("Frame: Loaded")
})

test("navigating turbo-frame[refresh=morph] from within morphs the contents", async ({ page }) => {
Expand All @@ -301,8 +298,7 @@ test("navigating turbo-frame[refresh=morph] from within morphs the contents", as
await nextBeat()

expect(await noNextEventOnTarget(page, "frame", "turbo:before-frame-morph")).toBeTruthy()
const frameText = await page.textContent("#frame h2")
assert.equal(frameText, "Frame: Loaded")
await expect(page.locator("#frame h2")).toHaveText("Frame: Loaded")
})

test("calling reload on a frame replaces the contents", async ({ page }) => {
Expand Down

0 comments on commit e429db7

Please sign in to comment.