1
1
import { prepareFlightRouterStateForRequest } from './flight-data-helpers'
2
2
import type { FlightRouterState } from '../server/app-render/types'
3
- import { HasLoadingBoundary } from '../server/app-render/types'
4
3
5
4
describe ( 'prepareFlightRouterStateForRequest' , ( ) => {
6
5
describe ( 'HMR refresh handling' , ( ) => {
@@ -11,7 +10,6 @@ describe('prepareFlightRouterStateForRequest', () => {
11
10
'/some/url' ,
12
11
'refresh' ,
13
12
true ,
14
- 1 ,
15
13
]
16
14
17
15
const result = prepareFlightRouterStateForRequest ( flightRouterState , true )
@@ -154,22 +152,6 @@ describe('prepareFlightRouterStateForRequest', () => {
154
152
expect ( decoded [ 4 ] ) . toBe ( false )
155
153
} )
156
154
157
- it ( 'should preserve hasLoadingBoundary' , ( ) => {
158
- const flightRouterState : FlightRouterState = [
159
- 'segment' ,
160
- { } ,
161
- null ,
162
- null ,
163
- undefined ,
164
- 1 , // HasLoadingBoundary value
165
- ]
166
-
167
- const result = prepareFlightRouterStateForRequest ( flightRouterState )
168
- const decoded = JSON . parse ( decodeURIComponent ( result ) )
169
-
170
- expect ( decoded [ 5 ] ) . toBe ( 1 )
171
- } )
172
-
173
155
it ( 'should handle minimal FlightRouterState (only segment and parallelRoutes)' , ( ) => {
174
156
const flightRouterState : FlightRouterState = [ 'segment' , { } ]
175
157
@@ -267,20 +249,17 @@ describe('prepareFlightRouterStateForRequest', () => {
267
249
'/modal/path' ,
268
250
'refresh' ,
269
251
false ,
270
- HasLoadingBoundary . SegmentHasLoadingBoundary ,
271
252
] ,
272
253
} ,
273
254
'/dashboard/url' ,
274
255
'refetch' ,
275
256
true ,
276
- 1 ,
277
257
] ,
278
258
sidebar : [ [ 'slug' , 'user-123' , 'd' ] , { } , '/sidebar/url' , null ] ,
279
259
} ,
280
260
'/main/url' ,
281
261
'inside-shared-layout' ,
282
262
true ,
283
- 1 ,
284
263
]
285
264
286
265
const result = prepareFlightRouterStateForRequest ( complexState )
@@ -291,7 +270,6 @@ describe('prepareFlightRouterStateForRequest', () => {
291
270
expect ( decoded [ 2 ] ) . toBeNull ( ) // URL stripped
292
271
expect ( decoded [ 3 ] ) . toBe ( 'inside-shared-layout' ) // server marker preserved
293
272
expect ( decoded [ 4 ] ) . toBe ( true ) // isRootLayout preserved
294
- expect ( decoded [ 5 ] ) . toBe ( 1 ) // hasLoadingBoundary preserved
295
273
296
274
// Children route checks
297
275
const childrenRoute = decoded [ 1 ] . children
@@ -305,7 +283,6 @@ describe('prepareFlightRouterStateForRequest', () => {
305
283
expect ( modalRoute [ 2 ] ) . toBeNull ( ) // URL stripped
306
284
expect ( modalRoute [ 3 ] ) . toBeNull ( ) // 'refresh' marker stripped
307
285
expect ( modalRoute [ 4 ] ) . toBe ( false ) // isRootLayout preserved
308
- expect ( modalRoute [ 5 ] ) . toBe ( HasLoadingBoundary . SegmentHasLoadingBoundary ) // hasLoadingBoundary preserved
309
286
310
287
// Sidebar route (dynamic segment) checks
311
288
const sidebarRoute = decoded [ 1 ] . sidebar
0 commit comments