Add test coverage of update notification

This commit is contained in:
Dean Herbert 2022-09-12 14:52:16 +09:00
parent eca241e9a7
commit 2b79e6b2de

View File

@ -12,6 +12,7 @@ using osu.Framework.Utils;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Updater;
namespace osu.Game.Tests.Visual.UserInterface namespace osu.Game.Tests.Visual.UserInterface
{ {
@ -134,6 +135,31 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("cancel notification", () => notification.State = ProgressNotificationState.Cancelled); AddStep("cancel notification", () => notification.State = ProgressNotificationState.Cancelled);
} }
[Test]
public void TestUpdateNotificationFlow()
{
bool applyUpdate = false;
AddStep(@"post update", () =>
{
applyUpdate = false;
var updateNotification = new UpdateManager.UpdateProgressNotification
{
CompletionClickAction = () => applyUpdate = true
};
notificationOverlay.Post(updateNotification);
progressingNotifications.Add(updateNotification);
});
checkProgressingCount(1);
waitForCompletion();
AddStep("click notification", () => notificationOverlay.ChildrenOfType<Notification>().Single().TriggerClick());
AddUntilStep("wait for update applied", () => applyUpdate);
}
[Test] [Test]
public void TestBasicFlow() public void TestBasicFlow()
{ {