mirror of
https://github.com/ppy/osu
synced 2025-01-12 09:09:44 +00:00
Add failing test coverage of searching too fast not hiding filtered settings
This commit is contained in:
parent
b6a2a5166e
commit
50a478ea5f
@ -4,10 +4,12 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Overlays.Settings.Sections;
|
using osu.Game.Overlays.Settings.Sections;
|
||||||
using osu.Game.Overlays.Settings.Sections.Input;
|
using osu.Game.Overlays.Settings.Sections.Input;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -34,6 +36,26 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestQuickFiltering()
|
||||||
|
{
|
||||||
|
AddStep("set filter", () =>
|
||||||
|
{
|
||||||
|
settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling";
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
|
||||||
|
|
||||||
|
AddAssert("ensure all items match filter", () => settings.SectionsContainer
|
||||||
|
.ChildrenOfType<SettingsSection>().Where(f => f.IsPresent)
|
||||||
|
.All(section =>
|
||||||
|
section.ChildrenOfType<Drawable>().Where(f => f.IsPresent)
|
||||||
|
.OfType<IFilterable>()
|
||||||
|
.Where(f => !(f is IHasFilterableChildren))
|
||||||
|
.All(f => f.FilterTerms.Any(t => t.Contains("scaling")))
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ToggleVisibility()
|
public void ToggleVisibility()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user