mirror of https://github.com/ppy/osu
Add test for initial button hover
This commit is contained in:
parent
3d1f051437
commit
9ec16bc2b2
|
@ -63,6 +63,7 @@ private void load(OsuGameBase game)
|
|||
testKeyDownWrapping();
|
||||
|
||||
testHideResets();
|
||||
testInitialButtonHover();
|
||||
|
||||
testMouseSelectionAfterKeySelection();
|
||||
testKeySelectionAfterMouseSelection();
|
||||
|
@ -159,6 +160,25 @@ private void testHideResets()
|
|||
AddAssert("Overlay state is reset", () => !failOverlay.Buttons.Any(b => b.Selected.Value));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests that entering menu with cursor initially on button selects it.
|
||||
/// </summary>
|
||||
private void testInitialButtonHover()
|
||||
{
|
||||
AddStep("Show overlay", () => pauseOverlay.Show());
|
||||
|
||||
var firstButton = pauseOverlay.Buttons.First();
|
||||
|
||||
AddStep("Hover first button", () => InputManager.MoveMouseTo(firstButton));
|
||||
|
||||
AddStep("Hide overlay", () => pauseOverlay.Hide());
|
||||
AddStep("Show overlay", () => pauseOverlay.Show());
|
||||
|
||||
AddAssert("First button selected", () => firstButton.Selected.Value);
|
||||
|
||||
AddStep("Hide overlay", () => pauseOverlay.Hide());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests that hovering a button that was previously selected with the keyboard correctly selects the new button and deselects the previous button.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue