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:
parent
5e059a362f
commit
910d74fdda
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user