From 69da1fa04c54e852e883b35e154cbe9b8db20609 Mon Sep 17 00:00:00 2001 From: Wadi <58947248+CaptFalc@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:52:56 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Updated=20Manage=20D?= =?UTF-8?q?ropdown=20in=20auth-methods=20accounts=20(#2432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 Updated Manage Dropdown in auth-methods accounts Updated Manage Dropdown in auth-methods account form to HDS ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14599 * refactor: 💡 Changed asssert statement in delete-test.js Changed statement to reflect proper syntax and testing capability ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14599 --- .../accounts/account/actions/index.hbs | 19 +++++++------------ .../tests/acceptance/accounts/delete-test.js | 15 ++++++++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ui/admin/app/components/auth-methods/auth-method/accounts/account/actions/index.hbs b/ui/admin/app/components/auth-methods/auth-method/accounts/account/actions/index.hbs index 3fd83bb84..abfdaa9b2 100644 --- a/ui/admin/app/components/auth-methods/auth-method/accounts/account/actions/index.hbs +++ b/ui/admin/app/components/auth-methods/auth-method/accounts/account/actions/index.hbs @@ -4,17 +4,12 @@ }} {{#if (can 'delete account' @model)}} - - + + - {{t 'resources.account.actions.delete'}} - - + /> + {{/if}} \ No newline at end of file diff --git a/ui/admin/tests/acceptance/accounts/delete-test.js b/ui/admin/tests/acceptance/accounts/delete-test.js index 4285ab387..0e8a35f83 100644 --- a/ui/admin/tests/acceptance/accounts/delete-test.js +++ b/ui/admin/tests/acceptance/accounts/delete-test.js @@ -20,6 +20,11 @@ module('Acceptance | accounts | delete', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); + const MANAGE_DROPDOWN_SELECTOR = + '[data-test-manage-account-auth-methods] div:first-child button'; + const DELETE_ACTION_SELECTOR = + '[data-test-manage-account-auth-methods] ul li button'; + const instances = { scopes: { global: null, @@ -67,7 +72,8 @@ module('Acceptance | accounts | delete', function (hooks) { test('can delete an account', async function (assert) { const accountsCount = this.server.db.accounts.length; await visit(urls.account); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); assert.strictEqual(this.server.db.accounts.length, accountsCount - 1); }); @@ -75,9 +81,7 @@ module('Acceptance | accounts | delete', function (hooks) { instances.account.authorized_actions = instances.account.authorized_actions.filter((item) => item !== 'delete'); await visit(urls.account); - assert.notOk( - find('.rose-layout-page-actions .rose-dropdown-button-danger'), - ); + assert.dom(MANAGE_DROPDOWN_SELECTOR).doesNotExist(); }); test('errors are displayed when delete on account fails', async function (assert) { @@ -93,7 +97,8 @@ module('Acceptance | accounts | delete', function (hooks) { ); }); await visit(urls.account); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); await a11yAudit(); assert.strictEqual( find('.rose-notification-body').textContent.trim(),