mirror of
https://github.com/ppy/osu.git
synced 2025-03-03 21:03:21 +08:00
Add test case covering reset section button hiding
This commit is contained in:
parent
3e403cfe03
commit
f05cb6bb5b
@ -7,6 +7,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Settings.Sections.Input;
|
||||
using osuTK.Input;
|
||||
@ -230,6 +231,22 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
AddAssert("first binding selected", () => multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().IsBinding);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFilteringHidesResetSectionButtons()
|
||||
{
|
||||
SearchTextBox searchTextBox = null;
|
||||
|
||||
AddStep("add any search term", () =>
|
||||
{
|
||||
searchTextBox = panel.ChildrenOfType<SearchTextBox>().Single();
|
||||
searchTextBox.Current.Value = "chat";
|
||||
});
|
||||
AddUntilStep("all reset section bindings buttons hidden", () => panel.ChildrenOfType<ResetButton>().All(button => button.Alpha == 0));
|
||||
|
||||
AddStep("clear search term", () => searchTextBox.Current.Value = string.Empty);
|
||||
AddUntilStep("all reset section bindings buttons shown", () => panel.ChildrenOfType<ResetButton>().All(button => button.Alpha == 1));
|
||||
}
|
||||
|
||||
private void checkBinding(string name, string keyName)
|
||||
{
|
||||
AddAssert($"Check {name} is bound to {keyName}", () =>
|
||||
|
Loading…
Reference in New Issue
Block a user