1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 23:23:12 +08:00

Fix a couple of broken tests

This commit is contained in:
Dean Herbert 2020-03-20 15:02:13 +09:00
parent 9b60b535e5
commit 8136ea561e
2 changed files with 11 additions and 5 deletions

View File

@ -278,6 +278,7 @@ namespace osu.Game.Tests.Visual.Background
private void setupUserSettings() private void setupUserSettings()
{ {
AddUntilStep("Song select is current", () => songSelect.IsCurrentScreen());
AddUntilStep("Song select has selection", () => songSelect.Carousel?.SelectedBeatmap != null); AddUntilStep("Song select has selection", () => songSelect.Carousel?.SelectedBeatmap != null);
AddStep("Set default user settings", () => AddStep("Set default user settings", () =>
{ {

View File

@ -432,13 +432,18 @@ namespace osu.Game.Tests.Visual.SongSelect
carousel.RemoveBeatmapSet(testMixed); carousel.RemoveBeatmapSet(testMixed);
testMixed = null; testMixed = null;
}); });
var testSingle = createTestBeatmapSet(set_count + 2); BeatmapSetInfo testSingle = null;
testSingle.Beatmaps.ForEach(b => AddStep("add single ruleset beatmapset", () =>
{ {
b.Ruleset = rulesets.AvailableRulesets.ElementAt(1); testSingle = createTestBeatmapSet(set_count + 2);
b.RulesetID = b.Ruleset.ID ?? 1; testSingle.Beatmaps.ForEach(b =>
{
b.Ruleset = rulesets.AvailableRulesets.ElementAt(1);
b.RulesetID = b.Ruleset.ID ?? 1;
});
carousel.UpdateBeatmapSet(testSingle);
}); });
AddStep("add single ruleset beatmapset", () => carousel.UpdateBeatmapSet(testSingle));
AddStep("select filtered map skipping filtered", () => carousel.SelectBeatmap(testSingle.Beatmaps[0], false)); AddStep("select filtered map skipping filtered", () => carousel.SelectBeatmap(testSingle.Beatmaps[0], false));
checkNoSelection(); checkNoSelection();
AddStep("remove single ruleset set", () => carousel.RemoveBeatmapSet(testSingle)); AddStep("remove single ruleset set", () => carousel.RemoveBeatmapSet(testSingle));