Skip to content

Commit

Permalink
Add failing test case for ruleset without all mod types
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed May 11, 2022
1 parent d4122f1 commit 315c67a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Tests.Mods;
using osuTK;
using osuTK.Input;

Expand Down Expand Up @@ -481,6 +482,21 @@ public void TestColumnHiding()
AddUntilStep("3 columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 3);
}

[Test]
public void TestColumnHidingOnRulesetChange()
{
createScreen();

changeRuleset(0);
AddAssert("5 columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 5);

AddStep("change to ruleset without all mod types", () => Ruleset.Value = TestCustomisableModRuleset.CreateTestRulesetInfo());
AddUntilStep("1 column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 1);

changeRuleset(0);
AddAssert("5 columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 5);
}

private void waitForColumnLoad() => AddUntilStep("all column content loaded",
() => modSelectOverlay.ChildrenOfType<ModColumn>().Any() && modSelectOverlay.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));

Expand Down

0 comments on commit 315c67a

Please sign in to comment.