Skip to content

Commit

Permalink
Float breaks loose head reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed May 7, 2024
1 parent 635e901 commit 71ab968
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions test/development/pages-dir/client-navigation/index.test.ts
Expand Up @@ -1672,30 +1672,42 @@ describe.each([[false], [true]])(
await waitFor(2000)
expect(
Number(await browser.eval('window.__test_async_executions'))
).toBe(1)
).toBe(
strictNextHead
? 1
: // <meta name="next-head-count" /> is floated before <script />.
// head-manager thinks it needs t add these again resulting in another execution.
2
)
expect(
Number(await browser.eval('window.__test_defer_executions'))
).toBe(1)
).toBe(
strictNextHead
? 1
: // <meta name="next-head-count" /> is floated before <script defer />.
// head-manager thinks it needs t add these again resulting in another execution.
2
)

await browser.elementByCss('#reverseScriptOrder').click()
await waitFor(2000)

expect(
Number(await browser.eval('window.__test_async_executions'))
).toBe(1)
).toBe(strictNextHead ? 1 : 2)
expect(
Number(await browser.eval('window.__test_defer_executions'))
).toBe(1)
).toBe(strictNextHead ? 1 : 2)

await browser.elementByCss('#toggleScript').click()
await waitFor(2000)

expect(
Number(await browser.eval('window.__test_async_executions'))
).toBe(1)
).toBe(strictNextHead ? 1 : 2)
expect(
Number(await browser.eval('window.__test_defer_executions'))
).toBe(1)
).toBe(strictNextHead ? 1 : 2)
} finally {
if (browser) {
await browser.close()
Expand Down

0 comments on commit 71ab968

Please sign in to comment.