From 392792eb92f1deb113adda894bd4dba24f17b829 Mon Sep 17 00:00:00 2001 From: Wadi <58947248+CaptFalc@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:41:08 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Updated=20Manage=20D?= =?UTF-8?q?ropdown=20in=20credential-library=20(#2434)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated Manage Dropdown present in credential-library to reflect new HDS design ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14601 --- .../credential-library/index.hbs | 20 ++++++++----------- .../credential-library/delete-test.js | 16 +++++++++++---- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/index.hbs index 2484bf06c..1abe1f856 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/index.hbs @@ -30,19 +30,15 @@ {{#if (can 'delete model' @model)}} - - + + + - {{t 'resources.credential-library.actions.delete'}} - - + /> + {{/if}} diff --git a/ui/admin/tests/acceptance/credential-library/delete-test.js b/ui/admin/tests/acceptance/credential-library/delete-test.js index f6dd4a1f8..bd6a91d8b 100644 --- a/ui/admin/tests/acceptance/credential-library/delete-test.js +++ b/ui/admin/tests/acceptance/credential-library/delete-test.js @@ -17,6 +17,10 @@ module('Acceptance | credential-libraries | delete', function (hooks) { setupMirage(hooks); let getCredentialLibraryCount; + const MANAGE_DROPDOWN_SELECTOR = + '[data-test-manage-credential-library-dropdown] div:first-child button'; + const DELETE_ACTION_SELECTOR = + '[data-test-manage-credential-library-dropdown] ul li button'; const instances = { scopes: { @@ -75,7 +79,8 @@ module('Acceptance | credential-libraries | delete', function (hooks) { test('can delete resource', async function (assert) { const count = getCredentialLibraryCount(); await visit(urls.credentialLibrary); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); assert.strictEqual(getCredentialLibraryCount(), count - 1); }); @@ -96,7 +101,8 @@ module('Acceptance | credential-libraries | delete', function (hooks) { confirmService.confirm = sinon.fake.returns(resolve()); const count = getCredentialLibraryCount(); await visit(urls.credentialLibrary); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); assert.strictEqual(getCredentialLibraryCount(), count - 1); assert.ok(confirmService.confirm.calledOnce); }); @@ -107,7 +113,8 @@ module('Acceptance | credential-libraries | delete', function (hooks) { confirmService.confirm = sinon.fake.returns(reject()); const count = getCredentialLibraryCount(); await visit(urls.credentialLibrary); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); assert.strictEqual(getCredentialLibraryCount(), count); assert.ok(confirmService.confirm.calledOnce); }); @@ -125,7 +132,8 @@ module('Acceptance | credential-libraries | delete', function (hooks) { ); }); await visit(urls.credentialLibrary); - await click('.rose-layout-page-actions .rose-dropdown-button-danger'); + await click(MANAGE_DROPDOWN_SELECTOR); + await click(DELETE_ACTION_SELECTOR); assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.'); }); });