next.js/test/e2e/app-dir/tailwind-css/tailwind-css.test.ts
tailwind-css.test.ts30 lines810 B
import { nextTestSetup } from 'e2e-utils'

describe('tailwind-css', () => {
  const { next } = nextTestSetup({
    files: __dirname,
    dependencies: {
      autoprefixer: '10.4.19',
      postcss: '8.4.38',
      tailwindcss: '3.4.4',
    },
  })

  it('works when importing tailwind/tailwind.css', async () => {
    const browser = await next.browser('/')
    try {
      const text = await browser.elementByCss('.text-6xl').text()
      expect(text).toMatch(/Welcome to/)
      const cssBlue = await browser
        .elementByCss('#test-link')
        .getComputedCss('color')
      expect(cssBlue).toBe('rgb(37, 99, 235)')

      expect(next.cliOutput).not.toContain('Module not found')
      expect(next.cliOutput).not.toContain("Can't resolve")
    } finally {
      await browser.close()
    }
  })
})
Quest for Codev2.0.0
/
SIGN IN