1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:28:00 +08:00

Add failing test coverage for double-click on disabled sliders

This commit is contained in:
Bartłomiej Dach 2023-10-26 11:59:38 +02:00
parent 5e059a362f
commit 910d74fdda
No known key found for this signature in database
2 changed files with 34 additions and 0 deletions

View File

@ -55,5 +55,22 @@ namespace osu.Game.Tests.Visual.UserInterface
AddAssert("slider is default", () => slider.Current.IsDefault);
}
[Test]
public void TestNubDoubleClickOnDisabledSliderDoesNothing()
{
AddStep("set slider to 1", () => slider.Current.Value = 1);
AddStep("disable slider", () => slider.Current.Disabled = true);
AddStep("move mouse to nub", () => InputManager.MoveMouseTo(slider.ChildrenOfType<Nub>().Single()));
AddStep("double click nub", () =>
{
InputManager.Click(MouseButton.Left);
InputManager.Click(MouseButton.Left);
});
AddAssert("slider is still at 1", () => slider.Current.Value, () => Is.EqualTo(1));
}
}
}

View File

@ -55,5 +55,22 @@ namespace osu.Game.Tests.Visual.UserInterface
AddAssert("slider is default", () => slider.Current.IsDefault);
}
[Test]
public void TestNubDoubleClickOnDisabledSliderDoesNothing()
{
AddStep("set slider to 1", () => slider.Current.Value = 1);
AddStep("disable slider", () => slider.Current.Disabled = true);
AddStep("move mouse to nub", () => InputManager.MoveMouseTo(slider.ChildrenOfType<ShearedNub>().Single()));
AddStep("double click nub", () =>
{
InputManager.Click(MouseButton.Left);
InputManager.Click(MouseButton.Left);
});
AddAssert("slider is still at 1", () => slider.Current.Value, () => Is.EqualTo(1));
}
}
}