forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: fix delete for SSH engine config (hashicorp#19448)
* fix delete not working for ssh config * add test * add changelog;
- Loading branch information
1 parent
62f3118
commit 75efaf0
Showing
6 changed files
with
76 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: fixes SSH engine config deletion | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
ui/tests/acceptance/settings/configure-secret-backends/configure-ssh-secret-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { click, settled } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import page from 'vault/tests/pages/settings/configure-secret-backends/pki/index'; | ||
import authPage from 'vault/tests/pages/auth'; | ||
import enablePage from 'vault/tests/pages/settings/mount-secret-backend'; | ||
import { create } from 'ember-cli-page-object'; | ||
import fm from 'vault/tests/pages/components/flash-message'; | ||
const flashMessage = create(fm); | ||
const SELECTORS = { | ||
generateSigningKey: '[data-test-ssh-input="generate-signing-key-checkbox"]', | ||
saveConfig: '[data-test-ssh-input="configure-submit"]', | ||
publicKey: '[data-test-ssh-input="public-key"]', | ||
}; | ||
module('Acceptance | settings/configure/secrets/ssh', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
hooks.beforeEach(function () { | ||
return authPage.login(); | ||
}); | ||
|
||
test('it configures ssh ca', async function (assert) { | ||
const path = `ssh-${new Date().getTime()}`; | ||
await enablePage.enable('ssh', path); | ||
await settled(); | ||
await page.visit({ backend: path }); | ||
await settled(); | ||
assert.dom(SELECTORS.generateSigningKey).isChecked('generate_signing_key defaults to true'); | ||
await click(SELECTORS.generateSigningKey); | ||
await click(SELECTORS.saveConfig); | ||
assert.strictEqual( | ||
flashMessage.latestMessage, | ||
'missing public_key', | ||
'renders warning flash message for failed save' | ||
); | ||
await click(SELECTORS.generateSigningKey); | ||
await click(SELECTORS.saveConfig); | ||
assert.dom(SELECTORS.publicKey).exists('renders public key after saving config'); | ||
}); | ||
}); |