mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
27 lines
731 B
TypeScript
27 lines
731 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { waitForNoRedbox } from 'next-test-utils'
|
|
|
|
describe('HMR Move File', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should work when moving a component to another directory', async () => {
|
|
const browser = await next.browser('/')
|
|
expect(await browser.elementByCss('#hello-world-button').text()).toBe(
|
|
'hello world'
|
|
)
|
|
|
|
await next.renameFile('app/button.tsx', 'app/button2.tsx')
|
|
await next.patchFile('app/page.tsx', (content) =>
|
|
content.replace('./button', './button2')
|
|
)
|
|
|
|
await waitForNoRedbox(browser)
|
|
|
|
expect(await browser.elementByCss('#hello-world-button').text()).toBe(
|
|
'hello world'
|
|
)
|
|
})
|
|
})
|