mirror of
https://github.com/osukey/osukey.git
synced 2025-07-24 11:50:03 +09:00
Move hover tests after key tests
This commit is contained in:
@ -56,17 +56,14 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
pauseOverlay.Retries = failOverlay.Retries = retryCount;
|
pauseOverlay.Retries = failOverlay.Retries = retryCount;
|
||||||
});
|
});
|
||||||
|
|
||||||
AddToggleStep("Toggle pause overlay", t => pauseOverlay.ToggleVisibility());
|
|
||||||
AddToggleStep("Toggle fail overlay", t => failOverlay.ToggleVisibility());
|
|
||||||
|
|
||||||
testHideResets();
|
|
||||||
|
|
||||||
testEnterWithoutSelection();
|
testEnterWithoutSelection();
|
||||||
testKeyUpFromInitial();
|
testKeyUpFromInitial();
|
||||||
testKeyDownFromInitial();
|
testKeyDownFromInitial();
|
||||||
testKeyUpWrapping();
|
testKeyUpWrapping();
|
||||||
testKeyDownWrapping();
|
testKeyDownWrapping();
|
||||||
|
|
||||||
|
testHideResets();
|
||||||
|
|
||||||
testMouseSelectionAfterKeySelection();
|
testMouseSelectionAfterKeySelection();
|
||||||
testKeySelectionAfterMouseSelection();
|
testKeySelectionAfterMouseSelection();
|
||||||
|
|
||||||
@ -76,19 +73,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
testEnterKeySelection();
|
testEnterKeySelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Test that hiding the overlay after hovering a button will reset the overlay to the initial state with no buttons selected.
|
|
||||||
/// </summary>
|
|
||||||
private void testHideResets()
|
|
||||||
{
|
|
||||||
AddStep("Show overlay", () => failOverlay.Show());
|
|
||||||
|
|
||||||
AddStep("Hover first button", () => InputManager.MoveMouseTo(failOverlay.Buttons.First()));
|
|
||||||
AddStep("Hide overlay", () => failOverlay.Hide());
|
|
||||||
|
|
||||||
AddAssert("Overlay state is reset", () => !failOverlay.Buttons.Any(b => b.Selected.Value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests that pressing enter after an overlay shows doesn't trigger an event because a selection hasn't occurred.
|
/// Tests that pressing enter after an overlay shows doesn't trigger an event because a selection hasn't occurred.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -162,6 +146,19 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("Hide overlay", () => failOverlay.Hide());
|
AddStep("Hide overlay", () => failOverlay.Hide());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test that hiding the overlay after hovering a button will reset the overlay to the initial state with no buttons selected.
|
||||||
|
/// </summary>
|
||||||
|
private void testHideResets()
|
||||||
|
{
|
||||||
|
AddStep("Show overlay", () => failOverlay.Show());
|
||||||
|
|
||||||
|
AddStep("Hover first button", () => InputManager.MoveMouseTo(failOverlay.Buttons.First()));
|
||||||
|
AddStep("Hide overlay", () => failOverlay.Hide());
|
||||||
|
|
||||||
|
AddAssert("Overlay state is reset", () => !failOverlay.Buttons.Any(b => b.Selected.Value));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests that hovering a button that was previously selected with the keyboard correctly selects the new button and deselects the previous button.
|
/// Tests that hovering a button that was previously selected with the keyboard correctly selects the new button and deselects the previous button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user