From bfde310ec04ca3b64c12cb4e0fec75ba5285a65a Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Tue, 25 Oct 2022 12:58:11 -0700 Subject: [PATCH] UI/vault 9268/pki component tests (#17609) * wip * work in progress * pki-role-form-test * clean up * radio-select-ttl-or-string test * clean up * add yielded check * 12 to 13 * add pki-key-usage test * remove meep * key-params test * clean up * clean up * pr comments --- ui/app/models/pki/pki-role-engine.js | 3 +- .../components/radio-select-ttl-or-string.hbs | 5 +- .../components/radio-select-ttl-or-string.js | 11 +- ui/lib/core/addon/helpers/is-active-route.js | 2 +- .../addon/components/pki-key-parameters.hbs | 2 +- ui/lib/pki/addon/components/pki-key-usage.hbs | 2 +- ui/lib/pki/addon/components/pki-key-usage.js | 2 + ui/lib/pki/addon/components/pki-role-form.hbs | 15 ++- ui/tests/helpers/pki-engine.js | 30 +++++ .../components/pki/pki-key-parameters-test.js | 101 ++++++++++++++++ .../components/pki/pki-key-usage-test.js | 85 +++++++++++++ .../components/pki/pki-role-form-test.js | 112 ++++++++++++++++++ .../pki/radio-select-ttl-or-string-test.js | 90 ++++++++++++++ 13 files changed, 448 insertions(+), 12 deletions(-) create mode 100644 ui/tests/helpers/pki-engine.js create mode 100644 ui/tests/integration/components/pki/pki-key-parameters-test.js create mode 100644 ui/tests/integration/components/pki/pki-key-usage-test.js create mode 100644 ui/tests/integration/components/pki/pki-role-form-test.js create mode 100644 ui/tests/integration/components/pki/radio-select-ttl-or-string-test.js diff --git a/ui/app/models/pki/pki-role-engine.js b/ui/app/models/pki/pki-role-engine.js index 8460ca5e75..c2fa644d56 100644 --- a/ui/app/models/pki/pki-role-engine.js +++ b/ui/app/models/pki/pki-role-engine.js @@ -22,8 +22,7 @@ export default class PkiRoleEngineModel extends Model { @attr('string', { label: 'Issuer reference', defaultValue: 'default', - subText: - 'Specifies the issuer that will be used to create certificates with this role. To find this, run [command]. By default, we will use the mounts default issuer.', + subText: `Specifies the issuer that will be used to create certificates with this role. To find this, run read -field=default pki_int/config/issuers in the console. By default, we will use the mounts default issuer.`, }) issuerRef; diff --git a/ui/lib/core/addon/components/radio-select-ttl-or-string.hbs b/ui/lib/core/addon/components/radio-select-ttl-or-string.hbs index 60ff240bc4..cc37e22bd2 100644 --- a/ui/lib/core/addon/components/radio-select-ttl-or-string.hbs +++ b/ui/lib/core/addon/components/radio-select-ttl-or-string.hbs @@ -5,6 +5,7 @@ @value="ttl" @onChange={{this.onRadioButtonChange}} @groupValue={{this.groupValue}} + data-test-radio-button="ttl" />