1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 23:33:23 +08:00

Add failing test case

This commit is contained in:
Salman Ahmed 2022-04-22 20:04:04 +03:00
parent 0dc3d1041f
commit 2961c383f6

View File

@ -33,18 +33,21 @@ namespace osu.Game.Tests.Visual.Settings
State = { Value = Visibility.Visible }
});
});
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
}
[Test]
public void TestQuickFiltering()
public void TestFiltering([Values] bool beforeLoad)
{
AddStep("set filter", () =>
{
settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling";
});
if (beforeLoad)
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
if (!beforeLoad)
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
AddAssert("ensure all items match filter", () => settings.SectionsContainer
.ChildrenOfType<SettingsSection>().Where(f => f.IsPresent)
.All(section =>
@ -56,6 +59,15 @@ namespace osu.Game.Tests.Visual.Settings
));
AddAssert("ensure section is current", () => settings.CurrentSection.Value is GraphicsSection);
AddAssert("ensure section is placed first", () => settings.CurrentSection.Value.Y == 0);
}
[Test]
public void TestFilterAfterLoad()
{
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
}
[Test]