File tree Expand file tree Collapse file tree
src/Uno.Extensions.Navigation.UI.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ public async Task When_GatedTabUnlockedByHR_Then_TabContentLoads(CancellationTok
296296 /// XAML HR removes <c>uen:Region.Attached="True"</c> from the TabBar element.
297297 /// Without Region.Attached the TabBar no longer drives navigation.
298298 /// Bug #2971: after such a change the content area goes blank.
299+ /// XAML HR replaces the page instance — must re-resolve to check the NEW page.
299300 /// </summary>
300301 [ TestMethod ]
301302 [ RunsOnUIThread ]
@@ -321,11 +322,14 @@ public async Task When_RegionAttachedRemovedFromTabBarViaXamlHR_Then_ContentNotB
321322 // Give the visual tree time to settle after XAML HR.
322323 await Task . Delay ( 1000 , ct ) ;
323324
324- // The content area should NOT be blank (#2971 causes this).
325- hostPage . ContentGrid . Children . Count . Should ( ) . BeGreaterThan ( 0 ,
325+ // XAML HR replaces the page — re-resolve to check the NEW page's state.
326+ var activePage = ResolveCurrentPage < HotReloadTabBarXamlPage > ( app . NavigationRoot ) ! ;
327+
328+ // The NEW page's content area should NOT be blank (#2971 causes this).
329+ activePage . ContentGrid . Children . Count . Should ( ) . BeGreaterThan ( 0 ,
326330 "Content area should not be blank after Region.Attached removal (#2971)" ) ;
327331
328- var tabOneVmAfter = FindTabContentVm ( hostPage . ContentGrid , "TabOne" ) ;
332+ var tabOneVmAfter = FindTabContentVm ( activePage . ContentGrid , "TabOne" ) ;
329333 tabOneVmAfter . Should ( ) . NotBeNull (
330334 "TabOne content should still be accessible after Region.Attached removal (#2971)" ) ;
331335 }
You can’t perform that action at this time.
0 commit comments