From 0082910353b66665aef3f63d33fc33c45f8c9b23 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 17 Sep 2024 20:42:43 -0700 Subject: [PATCH] Add testing for loading operation --- .../Playlists/TestScenePlaylistsLoungeSubScreen.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.cs b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.cs index 64b088a31c..1750234623 100644 --- a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.cs +++ b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsLoungeSubScreen.cs @@ -3,6 +3,7 @@ #nullable disable +using System; using System.Linq; using NUnit.Framework; using osu.Framework.Bindables; @@ -23,6 +24,7 @@ namespace osu.Game.Tests.Visual.Playlists protected new TestRoomManager RoomManager => (TestRoomManager)base.RoomManager; private TestLoungeSubScreen loungeScreen; + private IDisposable loadingOperation; public override void SetUpSteps() { @@ -104,6 +106,16 @@ namespace osu.Game.Tests.Visual.Playlists AddStep("search for room 1", () => this.ChildrenOfType().Single().Current.Value = "room 1"); AddUntilStep("filter text is 1 match", () => this.ChildrenOfType().Single().FilterText.ToString(), () => Is.EqualTo("1 match")); + + AddStep("begin loading operation", () => loadingOperation = OngoingOperationTracker.BeginOperation()); + + AddAssert("filter text is loading...", () => this.ChildrenOfType().Single().FilterText.ToString(), () => Is.EqualTo("loading...")); + + AddStep("finish loading operation", () => + { + loadingOperation?.Dispose(); + loadingOperation = null; + }); } private bool checkRoomVisible(DrawableRoom room) =>