1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Add test coverage

This commit is contained in:
Salman Ahmed 2021-08-13 06:31:39 +03:00
parent c10320f239
commit 1892db7f37

View File

@ -6,6 +6,7 @@ using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
@ -13,6 +14,8 @@ using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.OnlinePlay.Multiplayer.Spectate;
using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osu.Game.Screens.Play.PlayerSettings;
using osu.Game.Tests.Beatmaps.IO;
using osu.Game.Users;
@ -80,6 +83,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddWaitStep("wait a bit", 20);
}
[Test]
public void TestSpectatorPlayerSettingsHidden()
{
start(new[] { PLAYER_1_ID, PLAYER_2_ID });
loadSpectateScreen(false);
AddUntilStep("wait for player loaders", () => this.ChildrenOfType<PlayerLoader>().Count() == 2);
AddAssert("all player loader settings hidden", () => this.ChildrenOfType<PlayerLoader>().All(l => l.ChildrenOfType<FillFlowContainer<PlayerSettingsGroup>>().Single().Alpha == 0f));
AddUntilStep("wait for players to load", () => spectatorScreen.AllPlayersLoaded);
AddAssert("all player settings hidden", () => this.ChildrenOfType<Player>().All(p => p.ChildrenOfType<PlayerSettingsOverlay>().Single().State.Value == Visibility.Hidden));
}
[Test]
public void TestTeamDisplay()
{