Commit 7a211f2d authored by Luke Sandberg's avatar Luke Sandberg

Skip CSS order shared chunks test for webpack

The test verifies Turbopack's CSS chunk ordering fix. Webpack has its own
CSS ordering behavior and this interleaved-shared-chunks scenario is not
yet fixed there, causing CI failures in webpack test modes.
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
parent 8a06a8c4
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
describe('css-order-shared-chunks', () => { // This test verifies Turbopack's CSS chunk ordering fix. Webpack has its own
const { next } = nextTestSetup({ // CSS ordering behavior and this specific interleaved-shared-chunks scenario
files: __dirname, // is not yet fixed there.
}) ;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
'css-order-shared-chunks',
it('should preserve CSS cascade order on route A with shared chunks', async () => { () => {
const browser = await next.browser('/a') const { next } = nextTestSetup({
// unique-a-final.module.css is imported last, so its color should win files: __dirname,
await retry(async () => {
expect(
await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color`
)
).toBe('rgb(0, 128, 0)')
}) })
})
it('should preserve CSS cascade order on route B with shared chunks', async () => { it('should preserve CSS cascade order on route A with shared chunks', async () => {
const browser = await next.browser('/b') const browser = await next.browser('/a')
// unique-b-final.module.css is imported last, so its color should win // unique-a-final.module.css is imported last, so its color should win
await retry(async () => { await retry(async () => {
expect( expect(
await browser.eval( await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color` `window.getComputedStyle(document.getElementById('target')).color`
) )
).toBe('rgb(128, 0, 128)') ).toBe('rgb(0, 128, 0)')
})
}) })
})
it('should preserve order when navigating from A to B', async () => { it('should preserve CSS cascade order on route B with shared chunks', async () => {
const browser = await next.browser('/a') const browser = await next.browser('/b')
// Verify A first // unique-b-final.module.css is imported last, so its color should win
await retry(async () => { await retry(async () => {
expect( expect(
await browser.eval( await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color` `window.getComputedStyle(document.getElementById('target')).color`
) )
).toBe('rgb(0, 128, 0)') ).toBe('rgb(128, 0, 128)')
})
}) })
// Navigate to B it('should preserve order when navigating from A to B', async () => {
await browser.elementByCss('a[href="/b"]').click() const browser = await next.browser('/a')
await browser.waitForElementByCss('#target') // Verify A first
await retry(async () => { await retry(async () => {
expect( expect(
await browser.eval( await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color` `window.getComputedStyle(document.getElementById('target')).color`
) )
).toBe('rgb(128, 0, 128)') ).toBe('rgb(0, 128, 0)')
}) })
})
it('should preserve order when navigating from B to A', async () => { // Navigate to B
const browser = await next.browser('/b') await browser.elementByCss('a[href="/b"]').click()
// Verify B first await browser.waitForElementByCss('#target')
await retry(async () => { await retry(async () => {
expect( expect(
await browser.eval( await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color` `window.getComputedStyle(document.getElementById('target')).color`
) )
).toBe('rgb(128, 0, 128)') ).toBe('rgb(128, 0, 128)')
})
}) })
// Navigate to A it('should preserve order when navigating from B to A', async () => {
await browser.elementByCss('a[href="/a"]').click() const browser = await next.browser('/b')
await browser.waitForElementByCss('#target') // Verify B first
await retry(async () => { await retry(async () => {
expect( expect(
await browser.eval( await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color` `window.getComputedStyle(document.getElementById('target')).color`
) )
).toBe('rgb(0, 128, 0)') ).toBe('rgb(128, 0, 128)')
})
// Navigate to A
await browser.elementByCss('a[href="/a"]').click()
await browser.waitForElementByCss('#target')
await retry(async () => {
expect(
await browser.eval(
`window.getComputedStyle(document.getElementById('target')).color`
)
).toBe('rgb(0, 128, 0)')
})
}) })
}) }
}) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment