From 88125d41ac0be1685391e85c5a08fac19255f0f4 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Fri, 3 Sep 2021 11:08:26 -0600 Subject: [PATCH] KV custom metadata test coverage (#12464) * test coverage * small changes * another small change * fix test * browserstack blah * add page object --- .../components/secret-create-or-update.hbs | 12 +- .../components/secret-edit-metadata.hbs | 1 + .../cluster/secrets/backend/metadata.hbs | 6 +- .../templates/components/info-table-row.hbs | 3 +- .../secrets/backend/kv/secret-test.js | 133 +++++++++++++++--- .../components/secret-edit-test.js | 1 + .../pages/secrets/backend/kv/edit-secret.js | 4 +- 7 files changed, 139 insertions(+), 21 deletions(-) diff --git a/ui/app/templates/components/secret-create-or-update.hbs b/ui/app/templates/components/secret-create-or-update.hbs index 771d59b09..7a5cae09c 100644 --- a/ui/app/templates/components/secret-create-or-update.hbs +++ b/ui/app/templates/components/secret-create-or-update.hbs @@ -136,8 +136,16 @@ {{#if (eq @mode "edit")}}
-
- +
+ {{#if @model.canReadSecretData}} + + {{else}} + + {{/if}} {{#if this.isCreateNewVersionFromOldVersion}}
diff --git a/ui/app/templates/components/secret-edit-metadata.hbs b/ui/app/templates/components/secret-edit-metadata.hbs index 3613883a9..24392d4ae 100644 --- a/ui/app/templates/components/secret-edit-metadata.hbs +++ b/ui/app/templates/components/secret-edit-metadata.hbs @@ -37,6 +37,7 @@ type="submit" disabled={{this.validationErrorCount}} class="button is-primary" + data-test-save-metadata > Save diff --git a/ui/app/templates/vault/cluster/secrets/backend/metadata.hbs b/ui/app/templates/vault/cluster/secrets/backend/metadata.hbs index 476e45126..bd1dc5a80 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/metadata.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/metadata.hbs @@ -55,7 +55,11 @@ @title="No custom metadata" @bottomBorder={{true}} @message="This data is version-agnostic and is usually used to describe the secret being stored."> - + Add metadata diff --git a/ui/lib/core/addon/templates/components/info-table-row.hbs b/ui/lib/core/addon/templates/components/info-table-row.hbs index 4bdb0696a..7fcf08018 100644 --- a/ui/lib/core/addon/templates/components/info-table-row.hbs +++ b/ui/lib/core/addon/templates/components/info-table-row.hbs @@ -11,7 +11,7 @@ {{/if}}
-
+
{{#if (has-block)}} {{yield}} {{else if valueIsBoolean}} @@ -21,6 +21,7 @@ class="icon-true" @size="l" @glyph="check-circle-outline" + data-test-boolean-true /> Yes {{else}}