@@ -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 : "v2 " ,
28+ protocol : "v1 " ,
2929 directory,
3030 project : {
3131 id : projectID ,
@@ -67,33 +67,31 @@ 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- location : { directory } ,
71- data : { branch : "review-pane-performance" , defaultBranch : " dev" } ,
70+ branch : "review-pane-performance" ,
71+ default_branch : " dev",
7272 } ) ,
7373 } ) ,
7474 )
75- await page . route ( "**/api/ vcs/diff**" , ( route ) => {
75+ await page . route ( "**/vcs/diff**" , ( route ) => {
7676 const url = new URL ( route . request ( ) . url ( ) )
77- const scope = url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" )
77+ const scope = url . searchParams . get ( "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- 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- } ) ,
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+ ) ,
9492 } )
9593 } )
96- await page . route ( "**/api/ pty*" , ( route ) =>
94+ await page . route ( "**/pty*" , ( route ) =>
9795 route . fulfill ( {
9896 status : 200 ,
9997 contentType : "application/json" ,
@@ -111,7 +109,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
111109 } ) ,
112110 } ) ,
113111 )
114- await page . route ( "**/api/ pty/pty_review_terminal*" , ( route ) =>
112+ await page . route ( "**/pty/pty_review_terminal*" , ( route ) =>
115113 route . fulfill ( {
116114 status : 200 ,
117115 contentType : "application/json" ,
@@ -129,7 +127,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
129127 } ) ,
130128 } ) ,
131129 )
132- await page . route ( "**/api/ pty/pty_review_terminal/connect-token*" , ( route ) =>
130+ await page . route ( "**/pty/pty_review_terminal/connect-token*" , ( route ) =>
133131 route . fulfill ( {
134132 status : 200 ,
135133 contentType : "application/json" ,
@@ -139,7 +137,7 @@ test("keeps the review tree and terminal sized when both panels are open", async
139137 } ) ,
140138 } ) ,
141139 )
142- await page . routeWebSocket ( "**/api/ pty/pty_review_terminal/connect" , ( ) => undefined )
140+ await page . routeWebSocket ( "**/pty/pty_review_terminal/connect" , ( ) => undefined )
143141 await page . addInitScript ( ( ) => {
144142 localStorage . setItem ( "settings.v3" , JSON . stringify ( { general : { newLayoutDesigns : true } } ) )
145143 localStorage . setItem (
@@ -177,8 +175,8 @@ test("keeps the review tree and terminal sized when both panels are open", async
177175 const lazyDiff = page . waitForRequest ( ( request ) => {
178176 const url = new URL ( request . url ( ) )
179177 return (
180- url . pathname === "/api/ vcs/diff" &&
181- url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
178+ url . pathname === "/vcs/diff" &&
179+ url . searchParams . get ( "directory" ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
182180 )
183181 } )
184182 await lastFile . click ( )
@@ -192,8 +190,8 @@ test("keeps the review tree and terminal sized when both panels are open", async
192190 const refreshedDiff = page . waitForRequest ( ( request ) => {
193191 const url = new URL ( request . url ( ) )
194192 return (
195- url . pathname === "/api/ vcs/diff" &&
196- url . searchParams . get ( "location[ directory] " ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
193+ url . pathname === "/vcs/diff" &&
194+ url . searchParams . get ( "directory" ) ?. replaceAll ( "\\" , "/" ) . endsWith ( "/src/branch/d00027" ) === true
197195 )
198196 } )
199197 sessionStatus [ sessionID ] = { type : "idle" }
0 commit comments