Unverified Commit c8e9e65d authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Test that nonlatin characters don’t cause hard reloads in hmr (#67077)

This test case covers https://github.com/vercel/next.js/issues/65117.

Fixes #65117
parent ce6ce9b0
...@@ -362,6 +362,37 @@ describe.each([[''], ['/docs']])( ...@@ -362,6 +362,37 @@ describe.each([[''], ['/docs']])(
} }
} }
}) })
it('should not full reload when nonlatin characters are used', async () => {
let browser = null
const pagePath = join('pages', 'hmr', 'nonlatin.js')
const originalContent = await next.readFile(pagePath)
try {
browser = await webdriver(next.url, basePath + '/hmr/nonlatin')
const timeOrigin = await browser.eval('performance.timeOrigin')
const editedContent = originalContent.replace(
'<div>テスト</div>',
'<div class="updated">テスト</div>'
)
// Change the page
await next.patchFile(pagePath, editedContent)
await browser.waitForElementByCss('.updated')
expect(await browser.eval('performance.timeOrigin')).toEqual(
timeOrigin
)
} finally {
// Finally is used so that we revert the content back to the original regardless of the test outcome
// restore the about page content.
await next.patchFile(pagePath, originalContent)
if (browser) {
await browser.close()
}
}
})
}) })
}) })
......
export default function NonLatin(props) {
return <div>テスト</div>
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment