@@ -25,7 +25,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
2525 let detailFailures = 1
2626 await page . setViewportSize ( { width : 1400 , height : 900 } )
2727 await mockOpenCodeServer ( page , {
28- protocol : "v1 " ,
28+ protocol : "v2 " ,
2929 directory,
3030 project : {
3131 id : projectID ,
@@ -67,31 +67,33 @@ test("keeps the review tree and terminal sized when both panels are open", async
6767 status : 200 ,
6868 contentType : "application/json" ,
6969 body : JSON . stringify ( {
70- branch : "review-pane-performance" ,
71- default_branch : " dev",
70+ location : { directory } ,
71+ data : { branch : "review-pane-performance" , defaultBranch : " dev" } ,
7272 } ) ,
7373 } ) ,
7474 )
75- await page . route ( "**/vcs/diff**" , ( route ) => {
75+ await page . route ( "**/api/ vcs/diff**" , ( route ) => {
7676 const url = new URL ( route . request ( ) . url ( ) )
77- const scope = url . searchParams . get ( "directory" ) ?. replaceAll ( "\\" , "/" )
77+ const scope = url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" )
7878 const detail = scope ?. endsWith ( "/src/branch/d00027" )
7979 if ( detail && detailFailures -- > 0 ) return route . fulfill ( { status : 500 , body : "retry detail" } )
8080 return route . fulfill ( {
8181 status : 200 ,
8282 contentType : "application/json" ,
83- body : JSON . stringify (
84- url . searchParams . get ( "mode" ) === "branch"
85- ? detail
86- ? branchDiffs
87- . filter ( ( diff ) => diff . file . startsWith ( "src/branch/d00027/" ) )
88- . map ( ( diff ) => fileDiff ( diff . file , diff . additions , true , detailVersion ) )
89- : branchDiffs
90- : Array . from ( { length : 7 } , ( _ , index ) => fileDiff ( `src/git-${ index } .ts` , 1 ) ) ,
91- ) ,
83+ body : JSON . stringify ( {
84+ location : { directory : scope ?? directory , project : { id : projectID , directory } } ,
85+ data :
86+ url . searchParams . get ( "mode" ) === "branch"
87+ ? detail
88+ ? branchDiffs
89+ . filter ( ( diff ) => diff . file . startsWith ( "src/branch/d00027/" ) )
90+ . map ( ( diff ) => fileDiff ( diff . file , diff . additions , true , detailVersion ) )
91+ : branchDiffs
92+ : Array . from ( { length : 7 } , ( _ , index ) => fileDiff ( `src/git-${ index } .ts` , 1 ) ) ,
93+ } ) ,
9294 } )
9395 } )
94- await page . route ( "**/pty*" , ( route ) =>
96+ await page . route ( "**/api/ pty*" , ( route ) =>
9597 route . fulfill ( {
9698 status : 200 ,
9799 contentType : "application/json" ,
@@ -109,7 +111,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
109111 } ) ,
110112 } ) ,
111113 )
112- await page . route ( "**/pty/pty_review_terminal*" , ( route ) =>
114+ await page . route ( "**/api/ pty/pty_review_terminal*" , ( route ) =>
113115 route . fulfill ( {
114116 status : 200 ,
115117 contentType : "application/json" ,
@@ -127,7 +129,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
127129 } ) ,
128130 } ) ,
129131 )
130- await page . route ( "**/pty/pty_review_terminal/connect-token*" , ( route ) =>
132+ await page . route ( "**/api/ pty/pty_review_terminal/connect-token*" , ( route ) =>
131133 route . fulfill ( {
132134 status : 200 ,
133135 contentType : "application/json" ,
@@ -137,7 +139,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
137139 } ) ,
138140 } ) ,
139141 )
140- await page . routeWebSocket ( "**/pty/pty_review_terminal/connect" , ( ) => undefined )
142+ await page . routeWebSocket ( "**/api/ pty/pty_review_terminal/connect" , ( ) => undefined )
141143 await page . addInitScript ( ( ) => {
142144 localStorage . setItem ( "settings.v3" , JSON . stringify ( { general : { newLayoutDesigns : true } } ) )
143145 localStorage . setItem (
@@ -175,8 +177,8 @@ test("keeps the review tree and terminal sized when both panels are open", async
175177 const lazyDiff = page . waitForRequest ( ( request ) => {
176178 const url = new URL ( request . url ( ) )
177179 return (
178- url . pathname === "/vcs/diff" &&
179- url . searchParams . get ( "directory" ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
180+ url . pathname === "/api/ vcs/diff" &&
181+ url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
180182 )
181183 } )
182184 await lastFile . click ( )
@@ -190,8 +192,8 @@ test("keeps the review tree and terminal sized when both panels are open", async
190192 const refreshedDiff = page . waitForRequest ( ( request ) => {
191193 const url = new URL ( request . url ( ) )
192194 return (
193- url . pathname === "/vcs/diff" &&
194- url . searchParams . get ( "directory" ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
195+ url . pathname === "/api/ vcs/diff" &&
196+ url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
195197 )
196198 } )
197199 sessionStatus [ sessionID ] = { type : "idle" }
0 commit comments