Files
vault/ui/tests/acceptance/unseal-test.js
claire bontempo 4ac07e1d97 UI: HDS adoption replace <ConfirmAction> component (#21520)
* replace confirm-action dropdown with button+modal

* add modal frame to sidebar

* fix weird paragraph indent

* pass button text as arg

* add warning color to rotate modals

* update seal action and config ssh

* cleanup confirm action

* edit form

* add dropdown arg

* put back seal text

* put back confirm button text

* fix toolbar stylinggp

* popup member group

* move up title

* finish popup- components

* keymgmt

* fix modal button logic

* remaining app template components

* add period for angel

* vault cluster items

* add button text assertion

* remaining instances

* remove arg for passing confirm text

* contextual confirm action components

* delete old components

* update docs

* ammend dropdown loading states, add getter for confirm button color

* address feedback

* remove @disabled arg and add @disabledMessage

* add changelog;

* mfa tests

* update test selectors

* lol cleanup selectors

* start confirm action tests WIP

* move dropdown class directly to component

* add default color of isInDropdown

* final cleanup

* add tests

* remove @buttonColor as arg for dropdown

* update confirm action tests

* updae modals with disabled message

* refactor provider edit test
2023-11-17 23:44:21 +00:00

50 lines
1.4 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { click, currentRouteName, currentURL, fillIn, settled, visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import VAULT_KEYS from 'vault/tests/helpers/vault-keys';
import authPage from 'vault/tests/pages/auth';
import { pollCluster } from 'vault/tests/helpers/poll-cluster';
const { unsealKeys } = VAULT_KEYS;
module('Acceptance | unseal', function (hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(function () {
return authPage.login();
});
test('seal then unseal', async function (assert) {
await visit('/vault/settings/seal');
assert.strictEqual(currentURL(), '/vault/settings/seal');
// seal
await click('[data-test-seal]');
await click('[data-test-confirm-button]');
await pollCluster(this.owner);
await settled();
assert.strictEqual(currentURL(), '/vault/unseal', 'vault is on the unseal page');
// unseal
for (const key of unsealKeys) {
await fillIn('[data-test-shamir-key-input]', key);
await click('button[type="submit"]');
await pollCluster(this.owner);
await settled();
}
assert.dom('[data-test-cluster-status]').doesNotExist('ui does not show sealed warning');
assert.strictEqual(currentRouteName(), 'vault.cluster.auth', 'vault is ready to authenticate');
});
});