mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Preserve the `import_map` config specified by the user ### Why? The default mode (webpack mode) supports the `import_map` config, so turbopack should also support it. ### How? Closes https://github.com/vercel/next.js/issues/71408
41 lines
1008 B
TypeScript
41 lines
1008 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { check } from 'next-test-utils'
|
|
|
|
describe('app dir - emotion-js', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: __dirname,
|
|
skipDeployment: true,
|
|
dependencies: {
|
|
'@emotion/react': 'latest',
|
|
'@emotion/cache': 'latest',
|
|
},
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('should render emotion-js css with compiler.emotion option correctly', async () => {
|
|
const browser = await next.browser('/')
|
|
const el = browser.elementByCss('h1')
|
|
expect(await el.text()).toBe('Blue')
|
|
await check(
|
|
async () =>
|
|
await browser.eval(
|
|
`window.getComputedStyle(document.querySelector('h1')).color`
|
|
),
|
|
'rgb(0, 0, 255)'
|
|
)
|
|
|
|
const el2 = browser.elementByCss('p')
|
|
expect(await el2.text()).toBe('Red')
|
|
await check(
|
|
async () =>
|
|
await browser.eval(
|
|
`window.getComputedStyle(document.querySelector('p')).color`
|
|
),
|
|
'rgb(255, 0, 0)'
|
|
)
|
|
})
|
|
})
|