Attempt to fix UI tests for PKI (#15374)

* ui/pki: Remove test for warning to re-generate root

With the multiple issuer feature merged from #15277, we can now allow
multiple root generations to occur in the mount. Remove the test for the
warning.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Fix test for empty CA chain

With Vault 1.11's #15277, we'll now always render the CAChain field on
response.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Fix formatting in role-ssh.js

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
Alexander Scheel
2022-05-12 11:20:50 -04:00
committed by GitHub
parent 6a6d6c705b
commit 56fb894934
3 changed files with 4 additions and 9 deletions

View File

@@ -36,7 +36,7 @@ const CA_FIELDS = [
'allowSubdomains',
'allowUserKeyIds',
'keyIdFormat',
'notBeforeDuration'
'notBeforeDuration',
];
export default Model.extend({

View File

@@ -64,7 +64,7 @@ elRplAzrMF4=
assert.dom(SELECTORS.issuingCa).exists('displays masked issuing CA');
assert.dom(SELECTORS.privateKey).exists('displays masked private key');
assert.dom(SELECTORS.serialNumber).exists('displays serial number');
assert.dom(SELECTORS.caChain).doesNotExist('does not display empty masked CA chain');
assert.dom(SELECTORS.caChain).exists('displays the CA chain');
await generatePage.back();
await settled();

View File

@@ -71,7 +71,7 @@ BXUV2Uwtxf+QCphnlht9muX2fsLIzDJea0JipWj1uf2H8OZsjE8=
};
test('cert config: generate', async function (assert) {
assert.expect(11);
assert.expect(10);
await mountAndNav(assert);
await settled();
assert.equal(currentRouteName(), 'vault.cluster.settings.configure-secret-backend.section');
@@ -91,11 +91,6 @@ BXUV2Uwtxf+QCphnlht9muX2fsLIzDJea0JipWj1uf2H8OZsjE8=
await page.form.back();
await page.form.generateCA();
await settled();
assert.ok(
page.flash.latestMessage.includes('You tried to generate a new root CA'),
'shows warning message'
);
});
test('cert config: upload', async function (assert) {
@@ -132,7 +127,7 @@ BXUV2Uwtxf+QCphnlht9muX2fsLIzDJea0JipWj1uf2H8OZsjE8=
await settled();
await page.form.csrField(csrVal).submit();
await settled();
assert.dom(SELECTORS.caChain).doesNotExist('does not display empty CA chain');
assert.dom(SELECTORS.caChain).exists('full CA chain is shown');
assert.dom(SELECTORS.privateKey).doesNotExist('does not display empty private key');
await click('.masked-input-toggle');
intermediateCert = document.querySelector('[data-test-masked-input]').innerText;