mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Hide notification read light when in a toast state
Also adds test coverage of read state and light.
This commit is contained in:
@ -219,6 +219,26 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddStep("cancel notification", () => notification.State = ProgressNotificationState.Cancelled);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestReadState()
|
||||
{
|
||||
SimpleNotification notification = null!;
|
||||
AddStep(@"post", () => notificationOverlay.Post(notification = new BackgroundNotification { Text = @"Welcome to osu!. Enjoy your stay!" }));
|
||||
AddUntilStep("check is toast", () => !notification.IsInToastTray);
|
||||
AddAssert("light is not visible", () => notification.ChildrenOfType<Notification.NotificationLight>().Single().Alpha == 0);
|
||||
|
||||
AddUntilStep("wait for forward to overlay", () => !notification.IsInToastTray);
|
||||
|
||||
setState(Visibility.Visible);
|
||||
AddAssert("state is not read", () => !notification.Read);
|
||||
AddUntilStep("light is visible", () => notification.ChildrenOfType<Notification.NotificationLight>().Single().Alpha == 1);
|
||||
|
||||
setState(Visibility.Hidden);
|
||||
setState(Visibility.Visible);
|
||||
AddAssert("state is read", () => notification.Read);
|
||||
AddUntilStep("light is not visible", () => notification.ChildrenOfType<Notification.NotificationLight>().Single().Alpha == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBasicFlow()
|
||||
{
|
||||
|
Reference in New Issue
Block a user