Secret Metadata Breadcrumb Bug (#19703)

* fixes issue navigating back a level using the breadcrumbs from kvv2 metadata view

* adds changelog entry

* deletes kv mount after breadcrumb test -- attempt to fix unrelated failing secrets tests
This commit is contained in:
Jordan Reimer 2023-03-23 10:25:56 -06:00 committed by GitHub
parent 8c6b266b7b
commit a3f26af4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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> <p.top>
<KeyValueHeader <KeyValueHeader
@baseKey={{hash id=this.id}} @baseKey={{hash id=this.id}}
@path="vault.cluster.secrets.backend.show" @path="vault.cluster.secrets.backend.list"
@mode="show" @mode="show"
@showCurrent={{true}} @showCurrent={{true}}
@root={{this.backendCrumb}} @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']);
});
});