mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +08:00
Update remaining test expectations with new behaviour
This commit is contained in:
parent
a62ba9e0d9
commit
31a9980686
@ -110,7 +110,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
AddStep(@"simple #1", sendHelloNotification);
|
||||
|
||||
AddAssert("Is visible", () => notificationOverlay.State.Value == Visibility.Visible);
|
||||
AddAssert("toast displayed", () => notificationOverlay.ToastCount == 1);
|
||||
AddAssert("is not visible", () => notificationOverlay.State.Value == Visibility.Hidden);
|
||||
|
||||
checkDisplayedCount(1);
|
||||
|
||||
@ -183,7 +184,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
}
|
||||
|
||||
private void checkDisplayedCount(int expected) =>
|
||||
AddAssert($"Displayed count is {expected}", () => notificationOverlay.UnreadCount.Value == expected);
|
||||
AddUntilStep($"Displayed count is {expected}", () => notificationOverlay.UnreadCount.Value == expected);
|
||||
|
||||
private void sendDownloadProgress()
|
||||
{
|
||||
|
@ -129,6 +129,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
public IBindable<int> UnreadCount => unreadCount;
|
||||
|
||||
public int ToastCount => toastTray.UnreadCount;
|
||||
|
||||
private readonly BindableInt unreadCount = new BindableInt();
|
||||
|
||||
private int runningDepth;
|
||||
@ -155,7 +157,10 @@ namespace osu.Game.Overlays
|
||||
playDebouncedSample(notification.PopInSampleName);
|
||||
|
||||
if (State.Value == Visibility.Hidden)
|
||||
{
|
||||
toastTray.Post(notification);
|
||||
updateCounts();
|
||||
}
|
||||
else
|
||||
addPermanently(notification);
|
||||
});
|
||||
@ -220,7 +225,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void updateCounts()
|
||||
{
|
||||
unreadCount.Value = sections.Select(c => c.UnreadCount).Sum();
|
||||
unreadCount.Value = sections.Select(c => c.UnreadCount).Sum() + toastTray.UnreadCount;
|
||||
}
|
||||
|
||||
private void markAllRead()
|
||||
|
@ -32,6 +32,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
public Action<Notification>? ForwardNotificationToPermanentStore { get; set; }
|
||||
|
||||
public int UnreadCount => toastFlow.Count(n => !n.WasClosed && !n.Read);
|
||||
|
||||
private int runningDepth;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
Loading…
Reference in New Issue
Block a user