mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add test coverage of clicking close button to dismiss
This commit is contained in:
@ -47,6 +47,35 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
notificationOverlay.UnreadCount.ValueChanged += count => { displayedCount.Text = $"displayed count: {count.NewValue}"; };
|
||||
});
|
||||
|
||||
[Test]
|
||||
public void TestDismissWithoutActivationCloseButton()
|
||||
{
|
||||
bool activated = false;
|
||||
SimpleNotification notification = null!;
|
||||
|
||||
AddStep("post", () =>
|
||||
{
|
||||
activated = false;
|
||||
notificationOverlay.Post(notification = new SimpleNotification
|
||||
{
|
||||
Text = @"Welcome to osu!. Enjoy your stay!",
|
||||
Activated = () => activated = true,
|
||||
});
|
||||
});
|
||||
|
||||
AddStep("click to activate", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(notificationOverlay
|
||||
.ChildrenOfType<Notification>().Single()
|
||||
.ChildrenOfType<Notification.CloseButton>().Single());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddUntilStep("wait for closed", () => notification.WasClosed);
|
||||
AddAssert("was not activated", () => !activated);
|
||||
AddStep("reset mouse position", () => InputManager.MoveMouseTo(Vector2.Zero));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDismissWithoutActivationRightClick()
|
||||
{
|
||||
|
Reference in New Issue
Block a user