@@ -98,7 +98,9 @@ test.describe("dynamicParams set to true", () => {
9898 test ( "should be HIT on a path that was prebuilt" , async ( { page } ) => {
9999 const res = await page . goto ( "/isr/dynamic-params-true/1" ) ;
100100 expect ( res ?. status ( ) ) . toEqual ( 200 ) ;
101- expect ( res ?. headers ( ) [ "x-nextjs-cache" ] ) . toEqual ( "HIT" ) ;
101+ const cacheHeader =
102+ res ?. headers ( ) [ "x-nextjs-cache" ] ?? res ?. headers ( ) [ "x-opennext-cache" ] ;
103+ expect ( cacheHeader ) . toEqual ( "HIT" ) ;
102104 const title = await page . getByTestId ( "title" ) . textContent ( ) ;
103105 const content = await page . getByTestId ( "content" ) . textContent ( ) ;
104106 expect ( title ) . toEqual ( "Post 1" ) ;
@@ -110,7 +112,9 @@ test.describe("dynamicParams set to true", () => {
110112 // We are gonna skip this one for now, turborepo caching can cause this page to be STALE once deployed
111113 test . skip ( "should SSR on a path that was not prebuilt" , async ( { page } ) => {
112114 const res = await page . goto ( "/isr/dynamic-params-true/11" ) ;
113- expect ( res ?. headers ( ) [ "x-nextjs-cache" ] ) . toEqual ( "MISS" ) ;
115+ const cacheHeader =
116+ res ?. headers ( ) [ "x-nextjs-cache" ] ?? res ?. headers ( ) [ "x-opennext-cache" ] ;
117+ expect ( cacheHeader ) . toEqual ( "MISS" ) ;
114118 const title = await page . getByTestId ( "title" ) . textContent ( ) ;
115119 const content = await page . getByTestId ( "content" ) . textContent ( ) ;
116120 expect ( title ) . toEqual ( "Post 11" ) ;
@@ -139,7 +143,9 @@ test.describe("dynamicParams set to false", () => {
139143 test ( "should be HIT on a path that was prebuilt" , async ( { page } ) => {
140144 const res = await page . goto ( "/isr/dynamic-params-false/1" ) ;
141145 expect ( res ?. status ( ) ) . toEqual ( 200 ) ;
142- expect ( res ?. headers ( ) [ "x-nextjs-cache" ] ) . toEqual ( "HIT" ) ;
146+ const cacheHeader =
147+ res ?. headers ( ) [ "x-nextjs-cache" ] ?? res ?. headers ( ) [ "x-opennext-cache" ] ;
148+ expect ( cacheHeader ) . toEqual ( "HIT" ) ;
143149 const title = await page . getByTestId ( "title" ) . textContent ( ) ;
144150 const content = await page . getByTestId ( "content" ) . textContent ( ) ;
145151 expect ( title ) . toEqual ( "Post 1" ) ;
0 commit comments