Repository: vercel/next.js
File: test/e2e/app-dir/app-css/index.test.ts (TypeScript)

Code before:
            /<link rel="stylesheet" href="[^<]+\.css(\?v=\d+)?"/g
          ),
        ].length
        expect(stylesheets).toBe(3)
      })
    })

    describe('css ordering', () => {
      it('should have inner layers take precedence over outer layers', async () => {
        const browser = await next.browser('/ordering')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h1')).color`
          )
        ).toBe('rgb(255, 0, 0)')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h2')).color`
          )
        ).toBe('rgb(255, 0, 0)')
      })
    })

    // Note to reviewer:
    // This probably should not be turbopack only, but let me know if this should be for everything.
    if (process.env.IS_TURBOPACK_TEST) {
      describe('css import URLs', () => {
        it('should not mangle external layers', async () => {
          const browser = await next.browser('/externalLayer')
          expect(
            await browser.eval(
              `window.getComputedStyle(document.querySelector('h1')).margin`
            )
          ).toBe('5px')
        })

        it('should not mangle relative layers', async () => {
          const browser = await next.browser('/relativeLayer')
          expect(
            await browser.eval(
              `window.getComputedStyle(document.querySelector('h2')).color`
            )
          ).toBe('rgb(255, 0, 0)')
        })

        it('should allow the supports attribute', async () => {
          const browser = await next.browser('/urlSupports')
          expect(
            await browser.eval(
              `window.getComputedStyle(document.querySelector('h1')).color`
            )

Review comment (suggestion):
if it passes for webpack we should enable it, if only a few tests don't work on webpack we should just disable those.

you can use `pnpm test-start-webpack test/e2e/app-dir/app-css/index.test.ts` to run this test under webpac

Code after:
            /<link rel="stylesheet" href="[^<]+\.css(\?v=\d+)?"/g
          ),
        ].length
        expect(stylesheets).toBe(3)
      })
    })

    describe('css ordering', () => {
      it('should have inner layers take precedence over outer layers', async () => {
        const browser = await next.browser('/ordering')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h1')).color`
          )
        ).toBe('rgb(255, 0, 0)')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h2')).color`
          )
        ).toBe('rgb(255, 0, 0)')
      })
    })

    describe('css import URLs', () => {
      it('should not mangle external layers', async () => {
        const browser = await next.browser('/externalLayer')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h1')).margin`
          )
        ).toBe('5px')
      })

      it('should not mangle relative layers', async () => {
        const browser = await next.browser('/relativeLayer')
        expect(
          await browser.eval(
            `window.getComputedStyle(document.querySelector('h2')).color`
          )
        ).toBe('rgb(255, 0, 0)')
      })

      // Broken in webpack, see https://github.com/vercel/next.js/issues/89602
      if (process.env.IS_TURBOPACK_TEST) {
        it('should allow the supports attribute', async () => {
          const browser = await next.browser('/urlSupports')
          expect(
            await browser.eval(
              `window.getComputedStyle(document.querySelector('h1')).color`
            )
          ).toBe('rgb(255, 0, 0)')