backport of commit 85c3eab989 (#19716)

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
This commit is contained in:
hc-github-team-secure-vault-core
2023-03-23 14:51:35 -04:00
committed by GitHub
parent cf51afab56
commit 4472e4a3fb
3 changed files with 33 additions and 1 deletions

3
changelog/19703.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
ui: fixes issue navigating back a level using the breadcrumb from secret metadata view
```

View File

@@ -2,7 +2,7 @@
<p.top>
<KeyValueHeader
@baseKey={{hash id=this.id}}
@path="vault.cluster.secrets.backend.show"
@path="vault.cluster.secrets.backend.list"
@mode="show"
@showCurrent={{true}}
@root={{this.backendCrumb}}

View File

@@ -0,0 +1,29 @@
import { create } from 'ember-cli-page-object';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { click, currentURL, fillIn, visit } from '@ember/test-helpers';
import authPage from 'vault/tests/pages/auth';
import consoleClass from 'vault/tests/pages/components/console/ui-panel';
const consolePanel = create(consoleClass);
module('Acceptance | kv | breadcrumbs', function (hooks) {
setupApplicationTest(hooks);
test('it should route back to parent path from metadata tab', async function (assert) {
await authPage.login();
await consolePanel.runCommands(['delete sys/mounts/kv', 'write sys/mounts/kv type=kv-v2']);
await visit('/vault/secrets/kv/list');
await click('[data-test-secret-create]');
await fillIn('[data-test-secret-path]', 'foo/bar');
await click('[data-test-secret-save]');
await click('[data-test-secret-metadata-tab]');
await click('[data-test-secret-breadcrumb="foo"]');
assert.strictEqual(
currentURL(),
'/vault/secrets/kv/list/foo/',
'Routes back to list view on breadcrumb click'
);
await consolePanel.runCommands(['delete sys/mounts/kv']);
});
});