Skip to content

Commit d7eb683

Browse files
committed
fix(test): resolve false positive in Test 7 by re-resolving page after XAML HR
1 parent 9ef021c commit d7eb683

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Uno.Extensions.Navigation.UI.Tests/Given_TabBarHotReload.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)