-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore the asynchronous rendering by awaiting `nextAnimationFrame` from within the `View.renderSnapshot` method instead of awaiting a `nextEventLoopTick` from within the `PageRenderer.renderElement` method.
- Loading branch information
1 parent
4c77a4c
commit 3151587
Showing
2 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
import { test } from "@playwright/test" | ||
import { assert } from "chai" | ||
import { nextBody, pathname } from "../helpers/page" | ||
|
||
const path = "/src/tests/fixtures/drive_custom_body.html" | ||
import { nextEventNamed, pathname } from "../helpers/page" | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(path) | ||
await page.goto("/src/tests/fixtures/drive_custom_body.html") | ||
}) | ||
|
||
test("test drive with a custom body element", async ({ page }) => { | ||
page.click("#drive") | ||
await nextBody(page) | ||
await page.click("#drive") | ||
await nextEventNamed(page, "turbo:load") | ||
|
||
assert.equal(pathname(page.url()), "/src/tests/fixtures/drive_custom_body_2.html") | ||
assert.equal(await page.textContent("h1"), "Drive (with custom body)") | ||
assert.equal(await page.textContent("#different-content"), "Drive 2") | ||
|
||
await page.goBack() | ||
await nextEventNamed(page, "turbo:load") | ||
|
||
assert.equal(pathname(page.url()), "/src/tests/fixtures/drive_custom_body.html") | ||
assert.equal(await page.textContent("h1"), "Drive (with custom body)") | ||
assert.equal(await page.textContent("#different-content"), "Drive 1") | ||
|
||
const h1 = await page.locator("h1") | ||
const differentContent = await page.locator("#different-content") | ||
await page.goForward() | ||
await nextEventNamed(page, "turbo:load") | ||
|
||
assert.equal(pathname(page.url()), "/src/tests/fixtures/drive_custom_body_2.html") | ||
assert.equal(await h1.textContent(), "Drive (with custom body)") | ||
assert.equal(await differentContent.textContent(), "Drive 2") | ||
assert.equal(await page.textContent("h1"), "Drive (with custom body)") | ||
assert.equal(await page.textContent("#different-content"), "Drive 2") | ||
}) |