Skip to content

Commit

Permalink
Add test: FlyoutContentUpdatesAfterChange
Browse files Browse the repository at this point in the history
  • Loading branch information
spadapet committed Sep 25, 2023
1 parent d602c22 commit ed2a168
Showing 1 changed file with 26 additions and 1 deletion.
Expand Up @@ -17,6 +17,30 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class ShellTests : ControlsHandlerTestBase
{
[Fact]
public async Task FlyoutContentUpdatesAfterChange()
{
var flyoutContent = new VerticalStackLayout()
{
new Label() { Text = "Flyout Content" }
};

await RunShellTest(shell =>
{
shell.FlyoutBehavior = FlyoutBehavior.Locked;
},
async (shell, handler) =>
{
Assert.False(flyoutContent.IsLoaded);
shell.FlyoutContent = flyoutContent;
await OnLoadedAsync(flyoutContent);
shell.FlyoutContent = null;
await OnUnloadedAsync(flyoutContent);
});
}

#if !MACCATALYST
[Fact]
public async Task LogicalChildrenPropagateCorrectly()
Expand Down Expand Up @@ -303,6 +327,8 @@ Thickness GetSafeArea()
return Thickness.Zero;
#endif
}
#endif

async Task RunShellTest(Action<Shell> action, Func<Shell, ShellHandler, Task> testAction)
{
SetupBuilder();
Expand All @@ -319,6 +345,5 @@ async Task RunShellTest(Action<Shell> action, Func<Shell, ShellHandler, Task> te
await testAction(shell, handler);
});
}
#endif
}
}

0 comments on commit ed2a168

Please sign in to comment.