@@ -387,8 +387,7 @@ describe('page router', () => {
387
387
} )
388
388
const res = await response . json ( )
389
389
const url = new URL ( res . url , 'http://n/' )
390
- expect ( url . pathname ) . toBe ( '/ssr-page-2/' )
391
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
390
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/ssr-page-2.json' )
392
391
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
393
392
expect ( response . headers . get ( 'x-nextjs-rewrite' ) ) . toBe ( '/ssr-page-2/' )
394
393
expect ( response . status ) . toBe ( 200 )
@@ -420,7 +419,7 @@ describe('page router', () => {
420
419
expect ( response . status ) . toBe ( 200 )
421
420
} )
422
421
423
- test < FixtureTestContext > ( 'should rewrite un-rewritten data requests to page route' , async ( ctx ) => {
422
+ test < FixtureTestContext > ( 'should NOT rewrite un-rewritten data requests to page route' , async ( ctx ) => {
424
423
await createFixture ( 'middleware-pages' , ctx )
425
424
await runPlugin ( ctx )
426
425
const origin = await LocalServer . run ( async ( req , res ) => {
@@ -443,8 +442,7 @@ describe('page router', () => {
443
442
} )
444
443
const res = await response . json ( )
445
444
const url = new URL ( res . url , 'http://n/' )
446
- expect ( url . pathname ) . toBe ( '/ssg/hello/' )
447
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
445
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/ssg/hello.json' )
448
446
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
449
447
expect ( response . status ) . toBe ( 200 )
450
448
} )
@@ -472,8 +470,7 @@ describe('page router', () => {
472
470
} )
473
471
const res = await response . json ( )
474
472
const url = new URL ( res . url , 'http://n/' )
475
- expect ( url . pathname ) . toBe ( '/blog/first/' )
476
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
473
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/blog/first.json' )
477
474
expect ( url . searchParams . get ( 'slug' ) ) . toBe ( 'first' )
478
475
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
479
476
expect ( response . status ) . toBe ( 200 )
0 commit comments