@@ -127,6 +127,9 @@ private void AssertNotFoundPageRendered()
127127 private void AssertUrlNotChanged ( string expectedUrl ) =>
128128 Browser . True ( ( ) => Browser . Url . Contains ( expectedUrl ) , $ "Expected URL to contain '{ expectedUrl } ', but found '{ Browser . Url } '") ;
129129
130+ private void AssertUrlChanged ( string urlPart ) =>
131+ Browser . False ( ( ) => Browser . Url . Contains ( urlPart ) , $ "Expected URL not to contain '{ urlPart } ', but found '{ Browser . Url } '") ;
132+
130133 [ Theory ]
131134 [ InlineData ( true , true ) ]
132135 [ InlineData ( true , false ) ]
@@ -163,6 +166,20 @@ public void NotFoundSetOnInitialization_ResponseStarted_SSR(bool hasReExecutionM
163166 AssertUrlNotChanged ( testUrl ) ;
164167 }
165168
169+ [ Theory ]
170+ [ InlineData ( true , true ) ]
171+ [ InlineData ( true , false ) ]
172+ [ InlineData ( false , true ) ]
173+ public void NotFoundSetOnInitialization_ResponseStarted_EnhancedNavigationDisabled_SSR ( bool hasReExecutionMiddleware , bool hasCustomNotFoundPageSet )
174+ {
175+ EnhancedNavigationTestUtil . SuppressEnhancedNavigation ( this , true , skipNavigation : true ) ;
176+ string reexecution = hasReExecutionMiddleware ? "/reexecution" : "" ;
177+ string testUrl = $ "{ ServerPathBase } { reexecution } /set-not-found-ssr-streaming?useCustomNotFoundPage={ hasCustomNotFoundPageSet } ";
178+ Navigate ( testUrl ) ;
179+ AssertNotFoundRendered_ResponseStarted_Or_POST ( hasReExecutionMiddleware , hasCustomNotFoundPageSet , testUrl ) ;
180+ AssertUrlChanged ( testUrl ) ;
181+ }
182+
166183 private void AssertNotFoundRendered_ResponseStarted_Or_POST ( bool hasReExecutionMiddleware , bool hasCustomNotFoundPageSet , string testUrl )
167184 {
168185 if ( hasCustomNotFoundPageSet )
0 commit comments