From 4efa1f23bb7c0ce836d0d59b8748cc4b8583d962 Mon Sep 17 00:00:00 2001 From: Jason Won Date: Tue, 26 Oct 2021 15:29:50 -0400 Subject: [PATCH] fix context menu test --- .../Editing/TestSceneComposerSelection.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs b/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs index 36663591f2..9aae595808 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs @@ -5,7 +5,10 @@ using System; using System.Linq; using NUnit.Framework; using osu.Framework.Testing; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps; +using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu; @@ -29,6 +32,9 @@ namespace osu.Game.Tests.Visual.Editing private ComposeBlueprintContainer blueprintContainer => Editor.ChildrenOfType().First(); + private ContextMenuContainer contextMenuContainer + => Editor.ChildrenOfType().First(); + private void moveMouseToObject(Func targetFunc) { AddStep("move mouse to object", () => @@ -52,18 +58,7 @@ namespace osu.Game.Tests.Visual.Editing AddStep("right click", () => InputManager.Click(MouseButton.Right)); AddAssert("hitobject selected", () => EditorBeatmap.SelectedHitObjects.Single() == addedObject); - - AddStep("delete from context menu", () => - { - var pos = blueprintContainer.SelectionBlueprints - .First(s => s.Item == addedObject) - .ChildrenOfType() - .First(); - - InputManager.MoveMouseTo(pos, new Vector2(50, 120)); - InputManager.Click(MouseButton.Left); - }); - AddAssert("no hitobjects in beatmap", () => EditorBeatmap.HitObjects.Count == 0); + AddAssert("context menu is visible", () => contextMenuContainer.ChildrenOfType().Single().State == MenuState.Open); } [Test]