Skip to content

Commit

Permalink
Add test case for #48506 (#48696)
Browse files Browse the repository at this point in the history
Closes NEXT-228
Closes NEXT-227
  • Loading branch information
shuding authored Apr 21, 2023
1 parent b5f7f84 commit 490dc86
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/app-dir/rsc-basic/app/app-react/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react'

export default function Page() {
return <div>{'version=' + React.version}</div>
}
5 changes: 5 additions & 0 deletions test/e2e/app-dir/rsc-basic/pages/pages-react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react'

export default function Page() {
return <div>{'version=' + React.version}</div>
}
15 changes: 15 additions & 0 deletions test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,21 @@ describe('app dir - rsc basics', () => {
expect(await res.text()).toBe('Hello from import-test.js')
})

it('should use stable react for pages', async () => {
const resPages = await next.fetch('/pages-react')
const versionPages = (await resPages.text()).match(
/<div>version=([^<]+)<\/div>/
)?.[1]

const resApp = await next.fetch('/app-react')
const versionApp = (await resApp.text()).match(
/<div>version=([^<]+)<\/div>/
)?.[1]

expect(versionPages).not.toInclude('-next-')
expect(versionApp).toInclude('-next-')
})

// disable this flaky test
it.skip('should support partial hydration with inlined server data in browser', async () => {
// Should end up with "next_streaming_data".
Expand Down

0 comments on commit 490dc86

Please sign in to comment.