From 1693c5986ed51ffaf992b6a217b1eea149a68bd6 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Wed, 28 Aug 2024 12:07:22 -0500 Subject: [PATCH] - fix --- .../TestCases.HostApp/Issues/Issue24434.cs | 52 +++++++++++-------- .../Tests/Issues/Issue24434.cs | 2 +- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue24434.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue24434.cs index f27554aafd86..c589c6ff1594 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue24434.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue24434.cs @@ -4,36 +4,44 @@ namespace Maui.Controls.Sample.Issues { [Issue(IssueTracker.Github, 24434, "Modifying a layout while view isn't part of the Window fails to update the layout visually", PlatformAffected.iOS)] - public class Issue24434 : ContentPage + public class Issue24434 : NavigationPage { - public Issue24434() + public Issue24434() : base(new TestPage()) { - VerticalStackLayout vsl = new VerticalStackLayout(); - vsl.Add(new Button() + } + + public class TestPage : ContentPage + { + public TestPage() { - Text = "Click me and you should see a label appear beneath me", - LineBreakMode = LineBreakMode.WordWrap, - AutomationId = "ClickMe", - Command = new Command(async () => + VerticalStackLayout vsl = new VerticalStackLayout(); + + vsl.Add(new Button() { - TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); - vsl.Unloaded += (_,_) => + Text = "Click me and you should see a label appear beneath me", + LineBreakMode = LineBreakMode.WordWrap, + AutomationId = "ClickMe", + Command = new Command(async () => { - vsl.Add(new Label { Text = "Hello, World!", AutomationId = "Success" }); - taskCompletionSource.TrySetResult(); - }; + TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); + vsl.Unloaded += (_, _) => + { + vsl.Add(new Label { Text = "Hello, World!", AutomationId = "Success" }); + taskCompletionSource.TrySetResult(); + }; + + await Navigation.PushAsync(new ContentPage() { Content = new Label() { Text = "I should just disappear" } }); + await Navigation.PushModalAsync(new ContentPage() { Content = new Label() { Text = "I should just disappear" } }); - await Navigation.PushAsync(new ContentPage(){ Content = new Label() { Text = "I should just disappear"}}); - await Navigation.PushModalAsync(new ContentPage(){ Content = new Label() { Text = "I should just disappear"}}); - - await taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(5)); - await Navigation.PopAsync(); - await Navigation.PopModalAsync(); - }) - }); + await taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(5)); + await Navigation.PopModalAsync(); + await Navigation.PopAsync(); + }) + }); - Content = vsl; + Content = vsl; + } } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24434.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24434.cs index a4421e4dcefa..8f7b078f06a2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24434.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24434.cs @@ -14,7 +14,7 @@ public Issue24434(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.Layout)] - public void TapThenDoubleTap() + public void ModifyingANonVisibleLayoutWorks() { App.WaitForElement("ClickMe"); App.Tap("ClickMe");