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

Add test coverage for column dimming behaviour

This commit is contained in:
Bartłomiej Dach 2022-04-25 23:41:40 +02:00
parent e13d0d02ae
commit 24a1eb8003
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -111,6 +111,35 @@ namespace osu.Game.Tests.Visual.UserInterface
&& SelectedMods.Value.Any(mod => mod.GetType() == typeof(OsuModMirror)));
}
[Test]
public void TestDimmedState()
{
createScreen();
changeRuleset(0);
AddUntilStep("any column dimmed", () => this.ChildrenOfType<ModColumn>().Any(column => !column.Active.Value));
ModColumn firstDimmed = null;
ModPanel firstPanel = null;
AddStep("click first panel on dimmed column", () =>
{
firstDimmed = this.ChildrenOfType<ModColumn>().First(column => !column.Active.Value);
firstPanel = firstDimmed.ChildrenOfType<ModPanel>().First();
InputManager.MoveMouseTo(firstPanel);
InputManager.Click(MouseButton.Left);
});
AddUntilStep("column undimmed", () => firstDimmed.Active.Value);
AddAssert("panel not selected", () => !firstPanel.Active.Value);
AddStep("click panel again", () =>
{
InputManager.MoveMouseTo(firstPanel);
InputManager.Click(MouseButton.Left);
});
AddUntilStep("panel selected", () => firstPanel.Active.Value);
}
[Test]
public void TestCustomisationToggleState()
{