@@ -1025,7 +1025,18 @@ try {
10251025 verifyLegacyDraft ( undefined , 'assistant' )
10261026 )
10271027 await check ( 'The UI completes without unexpected browser runtime errors' , async ( ) => {
1028- await expect . poll ( ( ) => browserErrorEventCount ) . toBe ( browserErrorCount )
1028+ const handledRedirectCount = ( ) =>
1029+ browserErrorEvents . reduce (
1030+ ( count , event ) =>
1031+ event . stage === 'Search URLs cannot change an agent conversation into an assistant' &&
1032+ event . url === `${ baseUrl . origin } ${ root } /search/chat/${ agentId } ` &&
1033+ event . digest === `NEXT_REDIRECT;replace;${ root } /chat/${ agentId } ;307;` &&
1034+ event . message . startsWith ( 'Minified React error #419;' )
1035+ ? count + event . count
1036+ : count ,
1037+ 0
1038+ )
1039+ await expect . poll ( ( ) => browserErrorEventCount - handledRedirectCount ( ) ) . toBe ( browserErrorCount )
10291040 const deniedRecoveries = browserErrorEvents . filter (
10301041 ( event ) =>
10311042 event . digest === 'NEXT_HTTP_ERROR_FALLBACK;404' &&
@@ -1036,7 +1047,11 @@ try {
10361047 ] . includes ( event . stage )
10371048 )
10381049 const recoveryCount = deniedRecoveries . reduce ( ( total , event ) => total + event . count , 0 )
1039- assert . equal ( browserErrorEventCount , recoveryCount , 'Unexpected browser error events' )
1050+ assert . equal (
1051+ browserErrorEventCount ,
1052+ recoveryCount + handledRedirectCount ( ) ,
1053+ 'Unexpected browser error events'
1054+ )
10401055 assert . equal ( browserErrorCount , recoveryCount , 'Unexpected browser runtime errors' )
10411056 for ( const sample of browserErrorSamples ) {
10421057 const matchedCount = deniedRecoveries
0 commit comments