Add test coverage

This commit is contained in:
Salman Ahmed 2024-02-23 18:16:35 +03:00
parent fdc0636554
commit c1db9d7819
2 changed files with 31 additions and 1 deletions

View File

@ -286,6 +286,36 @@ namespace osu.Game.Tests.Visual.Multiplayer
});
}
[Test]
[FlakyTest] // See above
public void TestModSelectOverlay()
{
AddStep("add playlist item", () =>
{
SelectedRoom.Value.Playlist.Add(new PlaylistItem(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo)
{
RulesetID = new OsuRuleset().RulesetInfo.OnlineID,
RequiredMods = new[]
{
new APIMod(new OsuModDoubleTime { SpeedChange = { Value = 2.0 } }),
new APIMod(new OsuModStrictTracking()),
},
AllowedMods = new[]
{
new APIMod(new OsuModFlashlight()),
new APIMod(new OsuModHardRock()),
}
});
});
ClickButtonWhenEnabled<MultiplayerMatchSettingsOverlay.CreateOrUpdateButton>();
AddUntilStep("wait for join", () => RoomJoined);
ClickButtonWhenEnabled<RoomSubScreen.UserModSelectButton>();
AddAssert("mod select shows unranked", () => this.ChildrenOfType<RankingInformationDisplay>().Single().Ranked.Value == false);
AddAssert("mod select shows different multiplier", () => !this.ChildrenOfType<RankingInformationDisplay>().Single().ModMultiplier.IsDefault);
}
private partial class TestMultiplayerMatchSubScreen : MultiplayerMatchSubScreen
{
[Resolved(canBeNull: true)]

View File

@ -184,7 +184,7 @@ namespace osu.Game.Overlays.Mods
RightContent.FadeTo(Collapsed.Value && !IsHovered ? 0 : 1, transition_duration, Easing.OutQuint);
}
private partial class BPMDisplay : RollingCounter<double>
public partial class BPMDisplay : RollingCounter<double>
{
protected override double RollingDuration => 250;