Skip to content

Commit

Permalink
Merge branch 'canary' into ci/update-more-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Dec 7, 2022
2 parents f1ad473 + 18d41a9 commit be588b0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -378,6 +378,27 @@ describe('app dir', () => {
}
)
;(isDev ? describe : describe.skip)('HMR', () => {
it('should HMR correctly for server component', async () => {
const filePath = 'app/dashboard/index/page.js'
const origContent = await next.readFile(filePath)

try {
const browser = await webdriver(next.url, '/dashboard/index')
expect(await browser.elementByCss('p').text()).toContain(
'hello from app/dashboard/index'
)

await next.patchFile(
filePath,
origContent.replace('hello from', 'swapped from')
)

await check(() => browser.elementByCss('p').text(), /swapped from/)
} finally {
await next.patchFile(filePath, origContent)
}
})

it('should HMR correctly for client component', async () => {
const filePath = 'app/client-component-route/page.js'
const origContent = await next.readFile(filePath)
Expand Down

0 comments on commit be588b0

Please sign in to comment.