mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:52:55 +08:00
Add test covering initial state propagation
This commit is contained in:
parent
a08c51f213
commit
b87327841d
@ -22,16 +22,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
public class TestSceneMultiplayerParticipantsList : MultiplayerTestScene
|
||||
{
|
||||
[SetUp]
|
||||
public new void Setup() => Schedule(() =>
|
||||
{
|
||||
Child = new ParticipantsList
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Size = new Vector2(380, 0.7f)
|
||||
};
|
||||
});
|
||||
public new void Setup() => Schedule(createNewParticipantsList);
|
||||
|
||||
[Test]
|
||||
public void TestAddUser()
|
||||
@ -92,6 +83,14 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
checkProgressBarVisibility(true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCorrectInitialState()
|
||||
{
|
||||
AddStep("set to downloading map", () => Client.ChangeBeatmapAvailability(BeatmapAvailability.Downloading(0)));
|
||||
AddStep("recreate list", createNewParticipantsList);
|
||||
checkProgressBarVisibility(true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBeatmapDownloadingStates()
|
||||
{
|
||||
@ -212,6 +211,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewParticipantsList()
|
||||
{
|
||||
Child = new ParticipantsList { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Size = new Vector2(380, 0.7f) };
|
||||
}
|
||||
|
||||
private void checkProgressBarVisibility(bool visible) =>
|
||||
AddUntilStep($"progress bar {(visible ? "is" : "is not")}visible", () =>
|
||||
this.ChildrenOfType<ProgressBar>().Single().IsPresent == visible);
|
||||
|
Loading…
Reference in New Issue
Block a user