1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 15:42:11 +08:00

Add failing test

This commit is contained in:
Bartłomiej Dach
2025-06-25 09:46:54 +02:00
Unverified
parent f1e23595e7
commit 57bfb37888
@@ -9,6 +9,7 @@ using osu.Framework.Extensions;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Online.Leaderboards;
using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
using osu.Game.Rulesets.Mods;
@@ -168,6 +169,30 @@ namespace osu.Game.Tests.Visual.Navigation
AddAssert("mod configured", () => ((OsuModMagnetised)Game.SelectedMods.Value.Single()).AttractionStrength.Value, () => Is.EqualTo(1.0f));
}
[Test]
public void TestLeaderboardCorrectInPlayer()
{
IWorkingBeatmap beatmap() => Game.Beatmap.Value;
PushAndConfirm(() => new SoloSongSelect());
AddStep("import beatmap", () => BeatmapImportHelper.LoadOszIntoOsu(Game, virtualTrack: true).WaitSafely());
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
AddStep("switch to next difficulty and immediately press enter", () =>
{
InputManager.Key(Key.Down);
Schedule(() => InputManager.Key(Key.Enter));
});
AddUntilStep("wait for player", () =>
{
DismissAnyNotifications();
return Game.ScreenStack.CurrentScreen is Player;
});
AddAssert("leaderboard matches gameplay beatmap", () => Game.ChildrenOfType<LeaderboardManager>().Single().CurrentCriteria?.Beatmap, () => Is.EqualTo(beatmap().BeatmapInfo));
}
private Func<Player> playToResults()
{
var player = playToCompletion();