mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Pin the dependency versions used by the Material UI new-link-behavior fixture. ### Why? The fixture currently installs `latest`, which now resolves `@mui/material` to 9.0.1. That version causes an SWC source-map panic while compiling the fixture, so an unrelated link behavior test fails before reaching its assertion. ### How? Replace the floating dependency versions with the known-good Material UI 5.11.16, Emotion 11, and prop-types versions previously used by the fixture. ### Verification - `pnpm build-all` - `pnpm prettier --with-node-modules --ignore-path .prettierignore --write test/e2e/new-link-behavior/material-ui.test.ts` - `npx eslint --config eslint.config.mjs --fix test/e2e/new-link-behavior/material-ui.test.ts` - `NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-webpack test/e2e/new-link-behavior/material-ui.test.ts` <!-- NEXT_JS_LLM_PR -->
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
import path from 'path'
|
|
|
|
const appDir = path.join(__dirname, 'material-ui')
|
|
|
|
describe('New Link Behavior with material-ui', () => {
|
|
const { next } = nextTestSetup({
|
|
files: {
|
|
pages: new FileRef(path.join(appDir, 'pages')),
|
|
src: new FileRef(path.join(appDir, 'src')),
|
|
'next.config.js': new FileRef(path.join(appDir, 'next.config.js')),
|
|
},
|
|
dependencies: {
|
|
'@emotion/cache': '11.10.5',
|
|
'@emotion/react': '11.10.6',
|
|
'@emotion/server': '11.10.0',
|
|
'@emotion/styled': '11.10.6',
|
|
'@mui/icons-material': '5.11.16',
|
|
'@mui/material': '5.11.16',
|
|
'prop-types': '15.8.1',
|
|
},
|
|
})
|
|
|
|
it('should render MuiLink with <a>', async () => {
|
|
const browser = await next.browser(`/`)
|
|
const element = browser.elementByCss('a[href="/about"]')
|
|
|
|
const color = await element.getComputedCss('color')
|
|
expect(color).toBe('rgb(25, 133, 123)')
|
|
|
|
const text = await element.text()
|
|
expect(text).toBe('Go to the about page')
|
|
})
|
|
})
|