@@ -2699,26 +2699,31 @@ it.live("reports why a page failed to load while the tab shows the error page",
26992699 ) . pipe ( Effect . provide ( layer ) ) ,
27002700) ;
27012701
2702- it . live ( "preview_open rejects a desktop navigation that failed before automation attached" , ( ) =>
2702+ it . effect ( "preview_open rejects a desktop navigation that failed before automation attached" , ( ) =>
27032703 Effect . scoped (
27042704 Effect . gen ( function * ( ) {
27052705 const { broker, tabId } = yield * ready ;
27062706 const manager = yield * Manager . PreviewManager ;
27072707 const channel = yield * DesktopChannel . DesktopBrowserChannel ;
27082708 desktopRendersNext = true ;
27092709 desktopPageUrl = "chrome-error://chromewebdata/" ;
2710- using _failure = vi . spyOn ( channel , "loadFailure" ) . mockReturnValue ( certificateError ) ;
2710+ const failure = {
2711+ ...certificateError ,
2712+ url :
"https://user:[email protected] /?token=private#fragment" , 2713+ } ;
2714+ using _failure = vi . spyOn ( channel , "loadFailure" ) . mockReturnValue ( failure ) ;
27112715 const error = yield * broker
27122716 . invoke < PreviewAutomationStatus > ( {
27132717 scope,
27142718 operation : "open" ,
2715- input : { url : certificateError . url , reuseExistingTab : false , open : false } ,
2719+ input : { url : failure . url , reuseExistingTab : false , open : false } ,
27162720 } )
27172721 . pipe ( Effect . flip ) ;
27182722 expect ( error ) . toMatchObject ( {
27192723 _tag : "PreviewAutomationExecutionError" ,
27202724 reason : `Navigation to ${ certificateError . url } failed: ${ certificateError . description } ` ,
27212725 } ) ;
2726+ expect ( JSON . stringify ( error ) ) . not . toMatch ( / s e c r e t | p r i v a t e | f r a g m e n t / ) ;
27222727 const { sessions } = yield * manager . list ( { threadId : scope . thread . threadId } ) ;
27232728 expect ( sessions . map ( ( session ) => session . tabId ) ) . toEqual ( [ tabId ] ) ;
27242729 } ) ,
0 commit comments