From b7c7bf5aed3d8fa0a2e9f3bb769ddb7b76ec401a Mon Sep 17 00:00:00 2001
From: OJ Kwon <1210596+kwonoj@users.noreply.github.com>
Date: Fri, 8 Sep 2023 09:33:14 -0700
Subject: [PATCH] test(tailwind): remove new fixture, make existing test passes
---
test/development/basic/tailwind-jit.test.ts | 8 +++-
test/e2e/basic-tailwind/index.test.ts | 46 ---------------------
test/e2e/basic-tailwind/pages/_app.js | 5 ---
test/e2e/basic-tailwind/pages/index.js | 16 -------
test/e2e/basic-tailwind/postcss.config.js | 6 ---
test/e2e/basic-tailwind/styles/global.css | 3 --
test/e2e/basic-tailwind/tailwind.config.js | 12 ------
test/turbopack-tests-manifest.js | 7 ++++
8 files changed, 14 insertions(+), 89 deletions(-)
delete mode 100644 test/e2e/basic-tailwind/index.test.ts
delete mode 100644 test/e2e/basic-tailwind/pages/_app.js
delete mode 100644 test/e2e/basic-tailwind/pages/index.js
delete mode 100644 test/e2e/basic-tailwind/postcss.config.js
delete mode 100644 test/e2e/basic-tailwind/styles/global.css
delete mode 100644 test/e2e/basic-tailwind/tailwind.config.js
diff --git a/test/development/basic/tailwind-jit.test.ts b/test/development/basic/tailwind-jit.test.ts
index 1852ba9d736285..8b8c0bbd5d02d8 100644
--- a/test/development/basic/tailwind-jit.test.ts
+++ b/test/development/basic/tailwind-jit.test.ts
@@ -2,7 +2,13 @@ import { join } from 'path'
import webdriver from 'next-webdriver'
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
-import { check } from 'next-test-utils'
+import { check, shouldRunTurboDevTest } from 'next-test-utils'
+
+// [TODO]: It is unclear why turbopack takes longer to run this test
+// remove once it's fixed
+if (shouldRunTurboDevTest()) {
+ jest.setTimeout(1000 * 60 * 5)
+}
describe('TailwindCSS JIT', () => {
let next: NextInstance
diff --git a/test/e2e/basic-tailwind/index.test.ts b/test/e2e/basic-tailwind/index.test.ts
deleted file mode 100644
index 4a7b3a6c04afc2..00000000000000
--- a/test/e2e/basic-tailwind/index.test.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/* eslint-env jest */
-import { createNext, FileRef } from 'e2e-utils'
-import webdriver from 'next-webdriver'
-import { join } from 'path'
-import type { NextInstance } from 'test/lib/next-modes/base'
-
-//[NOTE]: This test is migrated from next-dev integration tests for turbopack,
-//Extracted into a single test file so we can put this in blocking tests for turbopack (turbopack-tests-manifests.js)
-describe('Render css with tailwind', () => {
- let next: NextInstance
- beforeAll(async () => {
- next = await createNext({
- files: {
- pages: new FileRef(join(__dirname, 'pages')),
- styles: new FileRef(join(__dirname, 'styles')),
- 'postcss.config.js': new FileRef(join(__dirname, 'postcss.config.js')),
- 'tailwind.config.js': new FileRef(
- join(__dirname, 'tailwind.config.js')
- ),
- },
- dependencies: {
- postcss: '^8.4.29',
- tailwindcss: '^3.3.3',
- autoprefixer: '^10.4.13',
- },
- })
- })
-
- afterAll(() => next?.destroy())
-
- it('should apply global styles', async () => {
- let browser
- try {
- browser = await webdriver(next.url, '/')
-
- const alignItems = await browser.eval(
- `window.getComputedStyle(document.querySelector('footer')).alignItems`
- )
- expect(alignItems).toMatchInlineSnapshot(`"center"`)
- } finally {
- if (browser) {
- await browser.close()
- }
- }
- })
-})
diff --git a/test/e2e/basic-tailwind/pages/_app.js b/test/e2e/basic-tailwind/pages/_app.js
deleted file mode 100644
index 0bd950249faeb7..00000000000000
--- a/test/e2e/basic-tailwind/pages/_app.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import '../styles/global.css'
-
-export default function MyApp({ Component, pageProps }) {
- return