- Revoke
-
+ />
{{#unless this.isRevoking}}
diff --git a/ui/tests/acceptance/mfa-method-test.js b/ui/tests/acceptance/mfa-method-test.js
index b6f8ddc53861..19f9256d9dcc 100644
--- a/ui/tests/acceptance/mfa-method-test.js
+++ b/ui/tests/acceptance/mfa-method-test.js
@@ -107,9 +107,13 @@ module('Acceptance | mfa-method', function (hooks) {
await visit('/vault/access/mfa/methods');
await click('[data-test-mfa-method-list-item]');
assert.dom('[data-test-tab="config"]').hasClass('active', 'Configuration tab is active by default');
+ await click('[data-test-delete-mfa-config]');
+
assert
- .dom('[data-test-confirm-action-trigger]')
- .isDisabled('Delete toolbar action disabled when method is attached to an enforcement');
+ .dom('[data-test-confirm-action-message]')
+ .hasText(
+ "This method cannot be deleted until its enforcements are deleted. This can be done from the 'Enforcements' tab."
+ );
const fields = [
['Issuer', 'Period', 'Key size', 'QR size', 'Algorithm', 'Digits', 'Skew', 'Max validation attempts'],
diff --git a/ui/tests/acceptance/oidc-config/clients-keys-test.js b/ui/tests/acceptance/oidc-config/clients-keys-test.js
index dd7f0dd9518e..b28a9759d77e 100644
--- a/ui/tests/acceptance/oidc-config/clients-keys-test.js
+++ b/ui/tests/acceptance/oidc-config/clients-keys-test.js
@@ -81,7 +81,7 @@ module('Acceptance | oidc-config clients and keys', function (hooks) {
// navigate to default key details from pop-up menu
await click('[data-test-popup-menu-trigger]');
await click('[data-test-oidc-key-menu-link="details"]');
- assert.dom(SELECTORS.keyDeleteButton).isDisabled('delete button is disabled for default key');
+ assert.dom(SELECTORS.keyDeleteButton).doesNotExist('delete button is hidden for default key');
await click(SELECTORS.keyEditButton);
assert.strictEqual(
currentRouteName(),
diff --git a/ui/tests/acceptance/oidc-config/providers-scopes-test.js b/ui/tests/acceptance/oidc-config/providers-scopes-test.js
index 8e822a239b74..7ae77c2a4437 100644
--- a/ui/tests/acceptance/oidc-config/providers-scopes-test.js
+++ b/ui/tests/acceptance/oidc-config/providers-scopes-test.js
@@ -376,7 +376,7 @@ module('Acceptance | oidc-config providers and scopes', function (hooks) {
);
await click('[data-test-oidc-provider-linked-block="default"] [data-test-popup-menu-trigger]');
await click('[data-test-oidc-provider-menu-link="details"]');
- assert.dom(SELECTORS.providerDeleteButton).isDisabled('delete button is disabled for default provider');
+ assert.dom(SELECTORS.providerDeleteButton).doesNotExist('delete button hidden for default provider');
});
// PROVIDER DELETE + EDIT PERMISSIONS
diff --git a/ui/tests/acceptance/pki/pki-engine-workflow-test.js b/ui/tests/acceptance/pki/pki-engine-workflow-test.js
index ea0d16398779..3afc02b25db9 100644
--- a/ui/tests/acceptance/pki/pki-engine-workflow-test.js
+++ b/ui/tests/acceptance/pki/pki-engine-workflow-test.js
@@ -126,8 +126,8 @@ module('Acceptance | pki workflow', function (hooks) {
await visit(`/vault/secrets/${this.mountPath}/pki/roles/some-role/details`);
assert.dom(SELECTORS.deleteRoleButton).exists('Delete role button is shown');
- await click(`${SELECTORS.deleteRoleButton} [data-test-confirm-action-trigger]`);
- await click(`[data-test-confirm-button]`);
+ await click(SELECTORS.deleteRoleButton);
+ await click('[data-test-confirm-button]');
assert.strictEqual(
currentURL(),
`/vault/secrets/${this.mountPath}/pki/roles`,
diff --git a/ui/tests/acceptance/policies-acl-old-test.js b/ui/tests/acceptance/policies-acl-old-test.js
index 3b68af86e756..156c44686c3a 100644
--- a/ui/tests/acceptance/policies-acl-old-test.js
+++ b/ui/tests/acceptance/policies-acl-old-test.js
@@ -55,7 +55,7 @@ module('Acceptance | policies (old)', function (hooks) {
await click('[data-test-policy-edit-toggle]');
- await click('[data-test-policy-delete] button');
+ await click('[data-test-confirm-action-trigger]');
await click('[data-test-confirm-button]');
await waitUntil(() => currentURL() === `/vault/policies/acl`);
diff --git a/ui/tests/acceptance/secrets/backend/kubernetes/roles-test.js b/ui/tests/acceptance/secrets/backend/kubernetes/roles-test.js
index 7f9310ba3882..28e6b5b2f8e1 100644
--- a/ui/tests/acceptance/secrets/backend/kubernetes/roles-test.js
+++ b/ui/tests/acceptance/secrets/backend/kubernetes/roles-test.js
@@ -105,7 +105,7 @@ module('Acceptance | kubernetes | roles', function (hooks) {
this.validateRoute(assert, 'roles.role.edit', 'Transitions to edit route');
await click('[data-test-cancel]');
await click('[data-test-list-item-link]');
- await click('[data-test-delete] button');
+ await click('[data-test-delete]');
await click('[data-test-confirm-button]');
assert
.dom('[data-test-list-item-link]')
diff --git a/ui/tests/acceptance/unseal-test.js b/ui/tests/acceptance/unseal-test.js
index 7b78864e7c56..26fb12d768a5 100644
--- a/ui/tests/acceptance/unseal-test.js
+++ b/ui/tests/acceptance/unseal-test.js
@@ -25,7 +25,7 @@ module('Acceptance | unseal', function (hooks) {
assert.strictEqual(currentURL(), '/vault/settings/seal');
// seal
- await click('[data-test-seal] button');
+ await click('[data-test-seal]');
await click('[data-test-confirm-button]');
diff --git a/ui/tests/helpers/oidc-config.js b/ui/tests/helpers/oidc-config.js
index f6e3a6ed8d05..670de3e4c93b 100644
--- a/ui/tests/helpers/oidc-config.js
+++ b/ui/tests/helpers/oidc-config.js
@@ -12,12 +12,12 @@ export const SELECTORS = {
oidcClientCreateButton: '[data-test-oidc-configure]',
oidcRouteTabs: '[data-test-oidc-tabs]',
oidcLandingImg: '[data-test-oidc-img]',
- confirmActionButton: '[data-test-confirm-button="true"]',
+ confirmActionButton: '[data-test-confirm-button]',
inlineAlert: '[data-test-inline-alert]',
// client route
clientSaveButton: '[data-test-oidc-client-save]',
clientCancelButton: '[data-test-oidc-client-cancel]',
- clientDeleteButton: '[data-test-oidc-client-delete] button',
+ clientDeleteButton: '[data-test-oidc-client-delete]',
clientEditButton: '[data-test-oidc-client-edit]',
clientDetailsTab: '[data-test-oidc-client-details]',
clientProvidersTab: '[data-test-oidc-client-providers]',
@@ -26,14 +26,14 @@ export const SELECTORS = {
assignmentSaveButton: '[data-test-oidc-assignment-save]',
assignmentCreateButton: '[data-test-oidc-assignment-create]',
assignmentEditButton: '[data-test-oidc-assignment-edit]',
- assignmentDeleteButton: '[data-test-oidc-assignment-delete] button',
+ assignmentDeleteButton: '[data-test-oidc-assignment-delete]',
assignmentCancelButton: '[data-test-oidc-assignment-cancel]',
assignmentDetailsTab: '[data-test-oidc-assignment-details]',
// scope routes
scopeSaveButton: '[data-test-oidc-scope-save]',
scopeCancelButton: '[data-test-oidc-scope-cancel]',
- scopeDeleteButton: '[data-test-oidc-scope-delete] button',
+ scopeDeleteButton: '[data-test-oidc-scope-delete]',
scopeEditButton: '[data-test-oidc-scope-edit]',
scopeDetailsTab: '[data-test-oidc-scope-details]',
scopeEmptyState: '[data-test-oidc-scope-empty-state]',
@@ -43,16 +43,16 @@ export const SELECTORS = {
// key route
keySaveButton: '[data-test-oidc-key-save]',
keyCancelButton: '[data-test-oidc-key-cancel]',
- keyDeleteButton: '[data-test-oidc-key-delete] button',
+ keyDeleteButton: '[data-test-oidc-key-delete]',
keyEditButton: '[data-test-oidc-key-edit]',
- keyRotateButton: '[data-test-oidc-key-rotate] button',
+ keyRotateButton: '[data-test-oidc-key-rotate]',
keyDetailsTab: '[data-test-oidc-key-details]',
keyClientsTab: '[data-test-oidc-key-clients]',
// provider route
providerSaveButton: '[data-test-oidc-provider-save]',
providerCancelButton: '[data-test-oidc-provider-cancel]',
- providerDeleteButton: '[data-test-oidc-provider-delete] button',
+ providerDeleteButton: '[data-test-oidc-provider-delete]',
providerEditButton: '[data-test-oidc-provider-edit]',
providerDetailsTab: '[data-test-oidc-provider-details]',
providerClientsTab: '[data-test-oidc-provider-clients]',
diff --git a/ui/tests/helpers/pki/page/pki-keys.js b/ui/tests/helpers/pki/page/pki-keys.js
index 82dd3031c83b..6026f9bcde98 100644
--- a/ui/tests/helpers/pki/page/pki-keys.js
+++ b/ui/tests/helpers/pki/page/pki-keys.js
@@ -18,7 +18,7 @@ export const SELECTORS = {
keyNameValue: '[data-test-value-div="Key name"]',
keyTypeValue: '[data-test-value-div="Key type"]',
keyBitsValue: '[data-test-value-div="Key bits"]',
- keyDeleteButton: '[data-test-pki-key-delete] button',
+ keyDeleteButton: '[data-test-pki-key-delete]',
downloadButton: '[data-test-download-button]',
keyEditLink: '[data-test-pki-key-edit]',
confirmDelete: '[data-test-confirm-button]',
diff --git a/ui/tests/integration/components/confirm-action-test.js b/ui/tests/integration/components/confirm-action-test.js
index 9602d62bc11a..839840e5f3ed 100644
--- a/ui/tests/integration/components/confirm-action-test.js
+++ b/ui/tests/integration/components/confirm-action-test.js
@@ -5,54 +5,155 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render, click } from '@ember/test-helpers';
+import { render, click, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import sinon from 'sinon';
+const SELECTORS = {
+ modalToggle: '[data-test-confirm-action-trigger]',
+ title: '[data-test-confirm-action-title]',
+ message: '[data-test-confirm-action-message]',
+ confirm: '[data-test-confirm-button]',
+ cancel: '[data-test-confirm-cancel-button]',
+};
module('Integration | Component | confirm-action', function (hooks) {
setupRenderingTest(hooks);
- test('it renders and on click shows the correct icon', async function (assert) {
- const confirmAction = sinon.spy();
- this.set('onConfirm', confirmAction);
+ hooks.beforeEach(function () {
+ this.onConfirm = sinon.spy();
+ });
+
+ test('it renders defaults and calls onConfirmAction', async function (assert) {
await render(hbs`
- DELETE
-
+ />
`);
- assert.dom('[data-test-icon="chevron-down"]').exists('Icon is pointing down');
- await click('[data-test-confirm-action-trigger="true"]');
- assert.dom('[data-test-icon="chevron-up"]').exists('Icon is now pointing up');
- assert.dom('[data-test-confirm-action-title]').hasText('Delete this?');
+
+ assert.dom(SELECTORS.modalToggle).hasText('DELETE', 'renders button text');
+ await click(SELECTORS.modalToggle);
+ // hasClass assertion wasn't working so this is the workaround
+ assert.strictEqual(
+ find('#confirm-action-modal').className,
+ 'hds-modal hds-modal--size-small hds-modal--color-critical',
+ 'renders critical modal color by default'
+ );
+ assert.strictEqual(
+ find(SELECTORS.confirm).className,
+ 'hds-button hds-button--size-medium hds-button--color-critical',
+ 'renders critical confirm button'
+ );
+ assert.dom(SELECTORS.title).hasText('Are you sure?', 'renders default title');
+ assert
+ .dom(SELECTORS.message)
+ .hasText('You will not be able to recover it later.', 'renders default body text');
+ await click(SELECTORS.cancel);
+ assert.false(this.onConfirm.called, 'does not call the action when Cancel is clicked');
+ await click(SELECTORS.modalToggle);
+ await click(SELECTORS.confirm);
+ assert.true(this.onConfirm.called, 'calls the action when Confirm is clicked');
+ assert.dom(SELECTORS.title).doesNotExist('modal closes after confirm is clicked');
});
- test('it closes the confirmation modal on successful delete', async function (assert) {
- const confirmAction = sinon.spy();
- this.set('onConfirm', confirmAction);
+ test('it renders isInDropdown defaults and calls onConfirmAction', async function (assert) {
await render(hbs`
- DELETE
-
+ @isInDropdown={{true}}
+ />
`);
- await click('[data-test-confirm-action-trigger="true"]');
- await click('[data-test-confirm-cancel-button="true"]');
- // assert that after CANCEL the icon button is pointing down.
- assert.dom('[data-test-icon="chevron-down"]').exists('Icon is pointing down after clicking cancel');
- // open the modal again to test the DELETE action
- await click('[data-test-confirm-action-trigger="true"]');
- await click('[data-test-confirm-button="true"]');
+
+ assert.dom(`li ${SELECTORS.modalToggle}`).exists('element renders inside
');
+ assert.dom(SELECTORS.modalToggle).hasClass('hds-confirm-action-critical', 'button has dropdown styling');
+ await click(SELECTORS.modalToggle);
+ assert.dom(SELECTORS.title).hasText('Are you sure?', 'renders default title');
assert
- .dom('[data-test-icon="chevron-down"]')
- .exists('Icon is pointing down after executing the Delete action');
- assert.true(confirmAction.called, 'calls the action when Delete is pressed');
+ .dom(SELECTORS.message)
+ .hasText('You will not be able to recover it later.', 'renders default body text');
+ await click('[data-test-confirm-cancel-button]');
+ assert.false(this.onConfirm.called, 'does not call the action when Cancel is clicked');
+ await click(SELECTORS.modalToggle);
+ await click(SELECTORS.confirm);
+ assert.true(this.onConfirm.called, 'calls the action when Confirm is clicked');
+ assert.dom(SELECTORS.title).doesNotExist('modal closes after confirm is clicked');
+ });
+
+ test('it renders loading state', async function (assert) {
+ await render(hbs`
+
+ `);
+
+ await click(SELECTORS.modalToggle);
+
+ assert.dom(SELECTORS.confirm).isDisabled('disables confirm button when loading');
+ assert.dom('[data-test-confirm-button] [data-test-icon="loading"]').exists('it renders loading icon');
+ });
+
+ test('it renders disabledMessage modal', async function (assert) {
+ this.condition = true;
+ await render(hbs`
+
+ `);
+
+ await click(SELECTORS.modalToggle);
+ assert.strictEqual(
+ find('#confirm-action-modal').className,
+ 'hds-modal hds-modal--size-small hds-modal--color-neutral',
+ 'renders critical modal color by default'
+ );
+ assert.dom(SELECTORS.title).hasText('Not allowed', 'renders disabled title');
assert
- .dom('[data-test-confirm-action-title]')
- .doesNotExist('it has closed the confirm content and does not show the title');
+ .dom(SELECTORS.message)
+ .hasText('This is the reason you cannot do the thing', 'renders disabled message as body text');
+ assert.dom(SELECTORS.confirm).doesNotExist('does not render confirm action button');
+ assert.dom(SELECTORS.cancel).hasText('Close');
+ });
+
+ test('it renders passed args', async function (assert) {
+ this.condition = false;
+ await render(hbs`
+
+ `);
+
+ // hasClass assertion wasn't working so this is the workaround
+ assert.strictEqual(
+ find(SELECTORS.modalToggle).className,
+ 'hds-button hds-button--size-medium hds-button--color-secondary',
+ 'renders @buttonColor classes'
+ );
+ await click(SELECTORS.modalToggle);
+ assert.strictEqual(
+ find('#confirm-action-modal').className,
+ 'hds-modal hds-modal--size-small hds-modal--color-warning',
+ 'renders warning modal'
+ );
+ assert.strictEqual(
+ find(SELECTORS.confirm).className,
+ 'hds-button hds-button--size-medium hds-button--color-primary',
+ 'renders primary confirm button'
+ );
+ assert.dom(SELECTORS.title).hasText('Do this?', 'renders passed title');
+ assert.dom(SELECTORS.message).hasText('Are you really, really sure?', 'renders passed body text');
+ assert.dom(SELECTORS.confirm).hasText('Confirm');
});
});
diff --git a/ui/tests/integration/components/confirm-test.js b/ui/tests/integration/components/confirm-test.js
deleted file mode 100644
index f5406c0f7e7d..000000000000
--- a/ui/tests/integration/components/confirm-test.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (c) HashiCorp, Inc.
- * SPDX-License-Identifier: BUSL-1.1
- */
-
-import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
-import { render, click } from '@ember/test-helpers';
-import hbs from 'htmlbars-inline-precompile';
-import sinon from 'sinon';
-
-module('Integration | Component | Confirm', function (hooks) {
- setupRenderingTest(hooks);
-
- hooks.beforeEach(function () {
- this.set('id', 'foo');
- this.set('title', 'Are you sure?');
- this.set('message', 'You will not be able to recover this item later.');
- this.set('triggerText', 'Click me!');
- this.set('onConfirm', sinon.spy());
- });
-
- test('it renders', async function (assert) {
- await render(hbs`
-
-
-
- `);
-
- assert.dom('.confirm-wrapper').exists();
- assert.dom('.confirm').containsText(this.triggerText);
- });
-
- test('does not show the confirmation message until it is triggered', async function (assert) {
- await render(hbs`
-
-
-
- `);
- assert.dom('.confirm-overlay').doesNotContainText(this.message);
-
- await click('[data-test-confirm-action-trigger]');
-
- assert.dom('.confirm-overlay').containsText(this.title);
- assert.dom('.confirm-overlay').containsText(this.message);
- });
-
- test('it calls onConfirm when the confirm button is clicked', async function (assert) {
- await render(hbs`
-
-
-
- `);
- await click('[data-test-confirm-action-trigger]');
- await click('[data-test-confirm-button=true]');
-
- assert.ok(this.onConfirm.calledOnce);
- });
-
- test('it shows only the active triggers message', async function (assert) {
- await render(hbs`
-
-
-
-
- `);
-
- await click(`[data-test-confirm-action-trigger=${this.id}]`);
- assert.dom('.confirm-overlay').containsText(this.title);
- assert.dom('.confirm-overlay').containsText(this.message);
-
- await click('[data-test-confirm-cancel-button]');
-
- await click("[data-test-confirm-action-trigger='bar']");
- assert.dom('.confirm-overlay').containsText('Wow');
- assert.dom('.confirm-overlay').containsText('Bazinga!');
- });
-});
diff --git a/ui/tests/integration/components/keymgmt/provider-edit-test.js b/ui/tests/integration/components/keymgmt/provider-edit-test.js
index d68fedd873de..10c8fe67cb39 100644
--- a/ui/tests/integration/components/keymgmt/provider-edit-test.js
+++ b/ui/tests/integration/components/keymgmt/provider-edit-test.js
@@ -8,7 +8,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setupMirage } from 'ember-cli-mirage/test-support';
-import { click, triggerEvent, settled, fillIn } from '@ember/test-helpers';
+import { click, settled, fillIn } from '@ember/test-helpers';
const ts = 'data-test-kms-provider';
const root = {
@@ -48,7 +48,7 @@ module('Integration | Component | keymgmt/provider-edit', function (hooks) {
});
test('it should render show view', async function (assert) {
- assert.expect(16);
+ assert.expect(10);
// override capability getters
Object.defineProperties(this.model, {
@@ -64,17 +64,6 @@ module('Integration | Component | keymgmt/provider-edit', function (hooks) {
},
};
});
- this.server.delete('/keymgmt/kms/foo-bar', () => {
- assert.ok(true, 'Request made to delete key');
- return {};
- });
- this.owner.lookup('service:router').reopen({
- transitionTo(path, model, { queryParams: { tab } }) {
- assert.strictEqual(path, root.path, 'Root path sent in transitionTo on delete');
- assert.strictEqual(model, root.model, 'Root model sent in transitionTo on delete');
- assert.deepEqual(tab, 'provider', 'Correct query params sent in transitionTo on delete');
- },
- });
const changeTab = async (tab) => {
this.set('tab', tab);
@@ -104,16 +93,58 @@ module('Integration | Component | keymgmt/provider-edit', function (hooks) {
assert.dom('[data-test-secret-link]').exists({ count: 2 }, 'Keys list renders');
await changeTab('details');
- assert.dom(`[${ts}-delete] button`).isDisabled('Delete action disabled when keys exist');
- await triggerEvent(`[data-test-tooltip-trigger]`, 'mouseenter');
- assert.dom(`[${ts}-delete-tooltip]`).exists('Tooltip is show when delete action is disabled');
+ await click(`[${ts}-delete]`);
+ assert
+ .dom('[data-test-confirm-action-message]')
+ .hasText(
+ 'This provider cannot be deleted until all 2 key(s) distributed to it are revoked. This can be done from the Keys tab.',
+ 'Renders disabled message'
+ );
+ await click('[data-test-confirm-cancel-button]');
+ });
+
+ test('it should delete a provider', async function (assert) {
+ assert.expect(5);
+
+ // override capability getters
+ Object.defineProperties(this.model, {
+ canDelete: { value: true },
+ canListKeys: { value: true },
+ });
+
+ this.server.post('/sys/capabilities-self', () => ({}));
+ this.server.get('/keymgmt/kms/foo-bar/key', () => {
+ return {
+ data: {
+ keys: [],
+ },
+ };
+ });
+ this.server.delete('/keymgmt/kms/foo-bar', () => {
+ assert.ok(true, 'Request made to delete key');
+ return {};
+ });
+ this.owner.lookup('service:router').reopen({
+ transitionTo(path, model, { queryParams: { tab } }) {
+ assert.strictEqual(path, root.path, 'Root path sent in transitionTo on delete');
+ assert.strictEqual(model, root.model, 'Root model sent in transitionTo on delete');
+ assert.deepEqual(tab, 'provider', 'Correct query params sent in transitionTo on delete');
+ },
+ });
+
+ await render(hbs`
+ `);
- this.model.keys = [];
- await settled();
assert
.dom('[data-test-value-div="Keys"]')
.hasText('None', 'None is displayed when no keys exist for provider');
- await click(`[${ts}-delete] button`);
+
+ await click(`[${ts}-delete]`);
await click('[data-test-confirm-button]');
});
diff --git a/ui/tests/integration/components/kubernetes/page/role/details-test.js b/ui/tests/integration/components/kubernetes/page/role/details-test.js
index fc88a30d3e16..91e3912ad773 100644
--- a/ui/tests/integration/components/kubernetes/page/role/details-test.js
+++ b/ui/tests/integration/components/kubernetes/page/role/details-test.js
@@ -104,13 +104,13 @@ module('Integration | Component | kubernetes | Page::Role::Details', function (h
return;
});
- assert.dom('[data-test-delete] button').hasText('Delete role', 'Delete action renders');
+ assert.dom('[data-test-delete]').hasText('Delete role', 'Delete action renders');
assert
.dom('[data-test-generate-credentials]')
.hasText('Generate credentials', 'Generate credentials action renders');
assert.dom('[data-test-edit]').hasText('Edit role', 'Edit action renders');
- await click('[data-test-delete] button');
+ await click('[data-test-delete]');
await click('[data-test-confirm-button]');
assert.ok(
transitionStub.calledWith('vault.cluster.secrets.backend.kubernetes.roles'),
diff --git a/ui/tests/integration/components/kv/page/kv-page-list-test.js b/ui/tests/integration/components/kv/page/kv-page-list-test.js
index 5b4a27a6ce13..bcf9e1aeb136 100644
--- a/ui/tests/integration/components/kv/page/kv-page-list-test.js
+++ b/ui/tests/integration/components/kv/page/kv-page-list-test.js
@@ -80,8 +80,8 @@ module('Integration | Component | kv | Page::List', function (hooks) {
const popupSelector = `${PAGE.list.item('my-secret-0')} ${PAGE.popup}`;
await click(popupSelector);
- await click('[data-test-confirm-action-trigger="true"]');
- await click('[data-test-confirm-button=true]');
+ await click('[data-test-confirm-action-trigger]');
+ await click('[data-test-confirm-button]');
assert.dom(PAGE.list.item('my-secret-0')).doesNotExist('deleted the first record from the list');
});
});
diff --git a/ui/tests/integration/components/ldap/page/configuration-test.js b/ui/tests/integration/components/ldap/page/configuration-test.js
index 5e75635eddaa..c8e51255ff46 100644
--- a/ui/tests/integration/components/ldap/page/configuration-test.js
+++ b/ui/tests/integration/components/ldap/page/configuration-test.js
@@ -13,7 +13,7 @@ import { duration } from 'core/helpers/format-duration';
import { createSecretsEngine, generateBreadcrumbs } from 'vault/tests/helpers/ldap';
const selectors = {
- rotateAction: '[data-test-toolbar-rotate-action] button',
+ rotateAction: '[data-test-toolbar-rotate-action]',
confirmRotate: '[data-test-confirm-button]',
configAction: '[data-test-toolbar-config-action]',
configCta: '[data-test-config-cta]',
diff --git a/ui/tests/integration/components/ldap/page/library/details-test.js b/ui/tests/integration/components/ldap/page/library/details-test.js
index c4573978d797..af5cac60e42a 100644
--- a/ui/tests/integration/components/ldap/page/library/details-test.js
+++ b/ui/tests/integration/components/ldap/page/library/details-test.js
@@ -65,11 +65,11 @@ module('Integration | Component | ldap | Page::Library::Details', function (hook
assert.dom('[data-test-tab="accounts"]').hasText('Accounts', 'Accounts tab renders');
assert.dom('[data-test-tab="config"]').hasText('Configuration', 'Configuration tab renders');
- assert.dom('[data-test-delete] button').hasText('Delete library', 'Delete action renders');
+ assert.dom('[data-test-delete]').hasText('Delete library', 'Delete action renders');
assert.dom('[data-test-edit]').hasText('Edit library', 'Edit action renders');
const transitionStub = sinon.stub(this.owner.lookup('service:router'), 'transitionTo');
- await click('[data-test-delete] button');
+ await click('[data-test-delete]');
await click('[data-test-confirm-button]');
assert.ok(
transitionStub.calledWith('vault.cluster.secrets.backend.ldap.libraries'),
diff --git a/ui/tests/integration/components/ldap/page/role/details-test.js b/ui/tests/integration/components/ldap/page/role/details-test.js
index 6a0ad36cf316..885bba9707ed 100644
--- a/ui/tests/integration/components/ldap/page/role/details-test.js
+++ b/ui/tests/integration/components/ldap/page/role/details-test.js
@@ -61,7 +61,7 @@ module('Integration | Component | ldap | Page::Role::Details', function (hooks)
await this.renderComponent('static');
- assert.dom('[data-test-delete] button').hasText('Delete role', 'Delete action renders');
+ assert.dom('[data-test-delete]').hasText('Delete role', 'Delete action renders');
assert.dom('[data-test-get-credentials]').hasText('Get credentials', 'Get credentials action renders');
assert.dom('[data-test-rotate-credentials]').exists('Rotate credentials action renders for static role');
assert.dom('[data-test-edit]').hasText('Edit role', 'Edit action renders');
@@ -78,7 +78,7 @@ module('Integration | Component | ldap | Page::Role::Details', function (hooks)
.dom('[data-test-rotate-credentials]')
.doesNotExist('Rotate credentials action is hidden for dynamic role');
- await click('[data-test-delete] button');
+ await click('[data-test-delete]');
await click('[data-test-confirm-button]');
assert.ok(
transitionStub.calledWith('vault.cluster.secrets.backend.ldap.roles'),
diff --git a/ui/tests/integration/components/seal-action-test.js b/ui/tests/integration/components/seal-action-test.js
index 19bcf382048c..65ca87e8739a 100644
--- a/ui/tests/integration/components/seal-action-test.js
+++ b/ui/tests/integration/components/seal-action-test.js
@@ -24,7 +24,7 @@ module('Integration | Component | seal-action', function (hooks) {
await render(hbs``);
// attempt seal
- await click('[data-test-seal] button');
+ await click('[data-test-seal]');
await click('[data-test-confirm-button]');
assert.ok(this.sealSuccess.calledOnce, 'called onSeal action');
@@ -36,7 +36,7 @@ module('Integration | Component | seal-action', function (hooks) {
await render(hbs``);
// attempt seal
- await click('[data-test-seal] button');
+ await click('[data-test-seal]');
await click('[data-test-confirm-button]');
assert.ok(this.sealError.calledOnce, 'called onSeal action');
diff --git a/ui/tests/pages/policies/index.js b/ui/tests/pages/policies/index.js
index 79407f65b977..f82c0e2bc91b 100644
--- a/ui/tests/pages/policies/index.js
+++ b/ui/tests/pages/policies/index.js
@@ -16,10 +16,6 @@ export default create({
findPolicyByName(name) {
return this.policies.filterBy('name', name)[0];
},
- delete: clickable('[data-test-confirm-action-trigger]', {
- testContainer: '#ember-testing',
- }),
- confirmDelete: clickable('[data-test-confirm-button]', {
- testContainer: '#ember-testing',
- }),
+ delete: clickable('[data-test-confirm-action-trigger]'),
+ confirmDelete: clickable('[data-test-confirm-button]'),
});
diff --git a/ui/tests/pages/policy/edit.js b/ui/tests/pages/policy/edit.js
index 15be98440c31..5cc814b7ab1c 100644
--- a/ui/tests/pages/policy/edit.js
+++ b/ui/tests/pages/policy/edit.js
@@ -6,6 +6,6 @@
import { clickable, create, isPresent, visitable } from 'ember-cli-page-object';
export default create({
visit: visitable('/vault/policy/:type/:name/edit'),
- deleteIsPresent: isPresent('[data-test-policy-delete]'),
+ deleteIsPresent: isPresent('[data-test-confirm-action-trigger]'),
toggleEdit: clickable('[data-test-policy-edit-toggle]'),
});
diff --git a/ui/tests/pages/secrets/backend/kv/show.js b/ui/tests/pages/secrets/backend/kv/show.js
index b3b219b657f8..f97afd0ae6af 100644
--- a/ui/tests/pages/secrets/backend/kv/show.js
+++ b/ui/tests/pages/secrets/backend/kv/show.js
@@ -11,7 +11,7 @@ export default create({
breadcrumbs: collection('[data-test-secret-breadcrumb]', {
text: text(),
}),
- deleteBtnV1: clickable('[data-test-secret-v1-delete="true"] button'),
+ deleteBtnV1: clickable('[data-test-secret-v1-delete]'),
confirmBtn: clickable('[data-test-confirm-button]'),
rows: collection('data-test-row-label'),
edit: clickable('[data-test-secret-edit]'),
diff --git a/ui/tests/pages/secrets/backend/list.js b/ui/tests/pages/secrets/backend/list.js
index 78088d0a299e..263013ceef40 100644
--- a/ui/tests/pages/secrets/backend/list.js
+++ b/ui/tests/pages/secrets/backend/list.js
@@ -33,12 +33,8 @@ export default create({
menuItems: collection('.ember-basic-dropdown-content li', {
testContainer: '#ember-testing',
}),
- delete: clickable('[data-test-confirm-action-trigger]', {
- testContainer: '#ember-testing',
- }),
- confirmDelete: clickable('[data-test-confirm-button]', {
- testContainer: '#ember-testing',
- }),
+ delete: clickable('[data-test-confirm-action-trigger]'),
+ confirmDelete: clickable('[data-test-confirm-button]'),
backendIsEmpty: getter(function () {
return this.secrets.length === 0;
}),
diff --git a/ui/tests/pages/secrets/backends.js b/ui/tests/pages/secrets/backends.js
index c19d8005bfb7..1c10e85c8d93 100644
--- a/ui/tests/pages/secrets/backends.js
+++ b/ui/tests/pages/secrets/backends.js
@@ -16,11 +16,7 @@ export default create({
configLink: clickable('[data-test-engine-config]', {
testContainer: '#ember-testing',
}),
- disableButton: clickable('[data-test-confirm-action-trigger]', {
- testContainer: '#ember-testing',
- }),
- confirmDisable: clickable('[data-test-confirm-button]', {
- testContainer: '#ember-testing',
- }),
+ disableButton: clickable('[data-test-confirm-action-trigger]'),
+ confirmDisable: clickable('[data-test-confirm-button]'),
console: uiPanel,
});