mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Add failing test case for broken hover behaviour
This commit is contained in:
parent
09139ef9f4
commit
8f217d1e97
@ -18,6 +18,7 @@ using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
@ -164,7 +165,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddStep("select mod requiring configuration", () => SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
|
||||
assertCustomisationToggleState(disabled: false, active: true);
|
||||
|
||||
AddStep("dismiss mod customisation via mouse", () =>
|
||||
AddStep("dismiss mod customisation via toggle", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(modSelectScreen.ChildrenOfType<ShearedToggleButton>().Single());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
@ -191,6 +192,29 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
assertCustomisationToggleState(disabled: true, active: false); // config was dismissed without explicit user action.
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDismissCustomisationViaDimmedArea()
|
||||
{
|
||||
createScreen();
|
||||
assertCustomisationToggleState(disabled: true, active: false);
|
||||
|
||||
AddStep("select mod requiring configuration", () => SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
|
||||
assertCustomisationToggleState(disabled: false, active: true);
|
||||
|
||||
AddStep("move mouse to settings area", () => InputManager.MoveMouseTo(this.ChildrenOfType<ModSettingsArea>().Single()));
|
||||
AddStep("move mouse to dimmed area", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(new Vector2(
|
||||
modSelectScreen.ScreenSpaceDrawQuad.TopLeft.X,
|
||||
(modSelectScreen.ScreenSpaceDrawQuad.TopLeft.Y + modSelectScreen.ScreenSpaceDrawQuad.BottomLeft.Y) / 2));
|
||||
});
|
||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||
assertCustomisationToggleState(disabled: false, active: false);
|
||||
|
||||
AddStep("move mouse to first mod panel", () => InputManager.MoveMouseTo(modSelectScreen.ChildrenOfType<ModPanel>().First()));
|
||||
AddAssert("first mod panel is hovered", () => modSelectScreen.ChildrenOfType<ModPanel>().First().IsHovered);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure that two mod overlays are not cross polluting via central settings instances.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user