Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Dec 12, 2024
1 parent a510ad9 commit 9b60312
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,52 +70,64 @@ describe('clearCacheNodeDataForSegmentPath', () => {
clearCacheNodeDataForSegmentPath(cache, existingCache, flightSegmentPath)

expect(cache).toMatchInlineSnapshot(`
{
"head": null,
"lazyData": null,
"loading": null,
"parallelRoutes": Map {
"children" => Map {
"linking" => {
"head": null,
"lazyData": null,
"loading": null,
"parallelRoutes": Map {
"children" => Map {
"" => {
"head": null,
"lazyData": null,
"loading": null,
"parallelRoutes": Map {},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": <React.Fragment>
Page
</React.Fragment>,
},
},
},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": <React.Fragment>
Linking
</React.Fragment>,
},
"dashboard" => {
"head": null,
"lazyData": null,
"loading": null,
"parallelRoutes": Map {},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": null,
},
},
},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": null,
}
{
"head": [
null,
null,
],
"lazyData": null,
"loading": null,
"parallelRoutes": Map {
"children" => Map {
"linking" => {
"head": [
null,
null,
],
"lazyData": null,
"loading": null,
"parallelRoutes": Map {
"children" => Map {
"" => {
"head": [
null,
null,
],
"lazyData": null,
"loading": null,
"parallelRoutes": Map {},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": <React.Fragment>
Page
</React.Fragment>,
},
},
},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": <React.Fragment>
Linking
</React.Fragment>,
},
"dashboard" => {
"head": [
null,
null,
],
"lazyData": null,
"loading": null,
"parallelRoutes": Map {},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": null,
},
},
},
"prefetchHead": null,
"prefetchRsc": null,
"rsc": null,
}
`)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('findHeadInCache', () => {
expect(result).not.toBeNull()

const [cacheNode, key] = result!
expect(cacheNode).toBe(null)
expect(cacheNode.head[0]).toBe(null)
expect(cacheNode.head[1]).toMatchObject(
<>
<title>About page!</title>
Expand Down

0 comments on commit 9b60312

Please sign in to comment.