1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Add failing test case for mod preset filtering not working after ruleset change

This commit is contained in:
Bartłomiej Dach 2023-06-18 14:45:43 +02:00
parent a49af06e88
commit 0b6c0592e4
No known key found for this signature in database

View File

@ -392,6 +392,28 @@ namespace osu.Game.Tests.Visual.UserInterface
new HashSet<Mod>(this.ChildrenOfType<ModPresetPanel>().First().Preset.Value.Mods).SetEquals(mods));
}
[Test]
public void TestTextFiltering()
{
ModPresetColumn modPresetColumn = null!;
AddStep("clear mods", () => SelectedMods.Value = Array.Empty<Mod>());
AddStep("create content", () => Child = modPresetColumn = new ModPresetColumn
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
AddUntilStep("items loaded", () => modPresetColumn.IsLoaded && modPresetColumn.ItemsLoaded);
AddStep("set osu! ruleset", () => Ruleset.Value = rulesets.GetRuleset(0));
AddStep("set text filter", () => modPresetColumn.SearchTerm = "First");
AddUntilStep("one panel visible", () => modPresetColumn.ChildrenOfType<ModPresetPanel>().Count(panel => panel.IsPresent), () => Is.EqualTo(1));
AddStep("set mania ruleset", () => Ruleset.Value = rulesets.GetRuleset(3));
AddUntilStep("no panels visible", () => modPresetColumn.ChildrenOfType<ModPresetPanel>().Count(panel => panel.IsPresent), () => Is.EqualTo(0));
}
private ICollection<ModPreset> createTestPresets() => new[]
{
new ModPreset