Skip to content

Commit

Permalink
backport of commit 85c3eab (#19714)
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Reimer <[email protected]>
  • Loading branch information
1 parent 36709b9 commit 030a41b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/19703.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: fixes issue navigating back a level using the breadcrumb from secret metadata view
```
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
29 changes: 29 additions & 0 deletions ui/tests/acceptance/secrets/backend/kv/breadcrumbs-test.js
Original file line number Diff line number Diff line change
@@ -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']);
});
});

0 comments on commit 030a41b

Please sign in to comment.