@@ -83,18 +83,28 @@ public void NavigatesWithoutInteractivityByRequestRedirection(bool controlFlowBy
8383 [ Theory ]
8484 [ InlineData ( true ) ]
8585 [ InlineData ( false ) ]
86- public void ProgrammaticNavigationToNotExistingPathReExecutesTo404 ( bool streaming )
86+ public void ProgrammaticNavigationToNotExistingPath_ReExecutesTo404 ( bool streaming )
8787 {
88+ AppContext . SetSwitch ( "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException" , isEnabled : true ) ;
8889 string streamingPath = streaming ? "-streaming" : "" ;
8990 Navigate ( $ "{ ServerPathBase } /reexecution/redirection-not-found-ssr{ streamingPath } ?navigate-programmatically=true") ;
9091 AssertReExecutionPageRendered ( ) ;
9192 }
9293
94+ [ Fact ]
95+ public void ProgrammaticNavigationToNotExistingPath_AfterAsyncOperation_ReExecutesTo404 ( )
96+ {
97+ AppContext . SetSwitch ( "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException" , isEnabled : true ) ;
98+ Navigate ( $ "{ ServerPathBase } /reexecution/redirection-not-found-ssr?doAsync=true&navigate-programmatically=true") ;
99+ AssertReExecutionPageRendered ( ) ;
100+ }
101+
93102 [ Theory ]
94103 [ InlineData ( true ) ]
95104 [ InlineData ( false ) ]
96- public void LinkNavigationToNotExistingPathReExecutesTo404 ( bool streaming )
105+ public void LinkNavigationToNotExistingPath_ReExecutesTo404 ( bool streaming )
97106 {
107+ AppContext . SetSwitch ( "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException" , isEnabled : true ) ;
98108 string streamingPath = streaming ? "-streaming" : "" ;
99109 Navigate ( $ "{ ServerPathBase } /reexecution/redirection-not-found-ssr{ streamingPath } ") ;
100110 Browser . Click ( By . Id ( "link-to-not-existing-page" ) ) ;
@@ -104,8 +114,9 @@ public void LinkNavigationToNotExistingPathReExecutesTo404(bool streaming)
104114 [ Theory ]
105115 [ InlineData ( true ) ]
106116 [ InlineData ( false ) ]
107- public void BrowserNavigationToNotExistingPathReExecutesTo404 ( bool streaming )
117+ public void BrowserNavigationToNotExistingPath_ReExecutesTo404 ( bool streaming )
108118 {
119+ AppContext . SetSwitch ( "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException" , isEnabled : true ) ;
109120 // non-existing path has to have re-execution middleware set up
110121 // so it has to have "reexecution" prefix. Otherwise middleware mapping
111122 // will not be activated, see configuration in Startup
0 commit comments