diff --git a/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs b/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs index ce912230d2..da0e3b9d73 100644 --- a/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs +++ b/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs @@ -21,9 +21,12 @@ public override void OneTimeSetUp() { base.OneTimeSetUp(); m_Asset = AssetDatabaseUtils.CreateAsset(); - m_Asset.AddActionMap("First Name"); + var actionMap = m_Asset.AddActionMap("First Name"); m_Asset.AddActionMap("Second Name"); m_Asset.AddActionMap("Third Name"); + + actionMap.AddAction("Action One"); + actionMap.AddAction("Action Two"); } public override void OneTimeTearDown() @@ -55,6 +58,19 @@ IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs }, $"WaitForActionMapRename {index} {isActive}", timeoutSecs); } + IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 5.0) + { + return WaitUntil(() => + { + var actionItems = m_Window.rootVisualElement.Q("actions-container").Query().ToList(); + if (actionItems.Count > index && actionItems[index].IsFocused == isActive) + { + return true; + } + return false; + }, $"WaitForActionRename {index} {isActive}", timeoutSecs); + } + #endregion [Test] @@ -177,5 +193,53 @@ public IEnumerator CanDeleteActionMap() Assert.That(m_Window.currentAssetInEditor.actionMaps[0].name, Is.EqualTo("First Name")); Assert.That(m_Window.currentAssetInEditor.actionMaps[1].name, Is.EqualTo("Third Name")); } + + [UnityTest] + [Ignore("Instability, see ISXB-1284")] + public IEnumerator CanRenameAction() + { + var actionContainer = m_Window.rootVisualElement.Q("actions-container"); + var actionItem = actionContainer.Query().ToList(); + Assume.That(actionItem[1].Q