@@ -292,12 +292,26 @@ describe("remote environment authorization", () => {
292292 "https://remote.example.com/api/auth/websocket-ticket/rpc" ,
293293 "https://remote.example.com/api/auth/websocket-ticket" ,
294294 ] ) ;
295- expect ( proofs . map ( ( proof ) => proof . url ) ) . toEqual ( [
296- "https://remote.example.com/api/auth/websocket-ticket/rpc" ,
297- "https://remote.example.com/api/auth/websocket-ticket" ,
298- "https://remote.example.com/ws" ,
295+ expect ( proofs ) . toEqual ( [
296+ {
297+ method : "POST" ,
298+ url : "https://remote.example.com/api/auth/websocket-ticket/rpc" ,
299+ accessToken : "dpop-access-token" ,
300+ } ,
301+ {
302+ method : "POST" ,
303+ url : "https://remote.example.com/api/auth/websocket-ticket" ,
304+ accessToken : "dpop-access-token" ,
305+ } ,
306+ { method : "GET" , url : "https://remote.example.com/ws" , accessToken : "old-ticket" } ,
299307 ] ) ;
300- expect ( url ) . toContain ( "wsTicket=old-ticket" ) ;
308+ expectFetchCall ( fetch . calls , 2 , {
309+ url : "https://remote.example.com/api/auth/websocket-ticket" ,
310+ method : "POST" ,
311+ headers : { dpop : "proof-2" } ,
312+ } ) ;
313+ expect ( new URL ( url ) . searchParams . get ( "wsTicket" ) ) . toBe ( "old-ticket" ) ;
314+ expect ( new URL ( url ) . searchParams . get ( "dpop" ) ) . toBe ( "proof-3" ) ;
301315 } ) ,
302316 ) ;
303317
0 commit comments