From 307d3709e06cea42cddfe80fc2219c4dcc12d33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 22 Dec 2021 09:32:38 +0100 Subject: [PATCH] Add failing test steps for selection behaviour on new point creation --- .../Editor/TestSceneSliderControlPointPiece.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs index d8618ee289..74d6d23348 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderControlPointPiece.cs @@ -92,6 +92,21 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertSelectionCount(1); assertSelected(0); + AddStep("move mouse to new point position", () => + { + Vector2 position = slider.Position + (slider.Path.ControlPoints[2].Position + slider.Path.ControlPoints[3].Position) / 2; + InputManager.MoveMouseTo(drawableObject.Parent.ToScreenSpace(position)); + }); + AddStep("ctrl+click to create new point", () => + { + InputManager.PressKey(Key.ControlLeft); + InputManager.Click(MouseButton.Left); + InputManager.ReleaseKey(Key.ControlLeft); + }); + AddAssert("slider has 6 control points", () => slider.Path.ControlPoints.Count == 6); + assertSelectionCount(1); + assertSelected(3); + void assertSelectionCount(int count) => AddAssert($"{count} control point pieces selected", () => this.ChildrenOfType().Count(piece => piece.IsSelected.Value) == count);