UI - auth method edit (#4770)
* add configuration tab for ldap, okta, radius auth methods * add tests to assert that configuration tabs show on supported auth methods
This commit is contained in:
parent
e285915915
commit
96277531eb
|
@ -39,6 +39,24 @@ const TABS_FOR_SETTINGS = {
|
|||
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
||||
},
|
||||
],
|
||||
ldap: [
|
||||
{
|
||||
label: 'Configuration',
|
||||
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
||||
},
|
||||
],
|
||||
okta: [
|
||||
{
|
||||
label: 'Configuration',
|
||||
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
||||
},
|
||||
],
|
||||
radius: [
|
||||
{
|
||||
label: 'Configuration',
|
||||
routeParams: ['vault.cluster.settings.auth.configure.section', 'configuration'],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const TABS_FOR_SHOW = {};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<nav class="tabs sub-nav">
|
||||
<ul>
|
||||
{{#each tabs as |tab|}}
|
||||
{{#link-to params=tab.routeParams tagName="li"}}
|
||||
{{#link-to params=tab.routeParams tagName="li" data-test-auth-section-tab=true}}
|
||||
<a href={{href-to params=tab.routeParams}}>
|
||||
{{tab.label}}
|
||||
</a>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
import { test } from 'qunit';
|
||||
import { create } from 'ember-cli-page-object';
|
||||
import moduleForAcceptance from 'vault/tests/helpers/module-for-acceptance';
|
||||
import enablePage from 'vault/tests/pages/settings/auth/enable';
|
||||
import page from 'vault/tests/pages/settings/auth/configure/section';
|
||||
import indexPage from 'vault/tests/pages/settings/auth/configure/index';
|
||||
import apiStub from 'vault/tests/helpers/noop-all-api-requests';
|
||||
import consolePanel from 'vault/tests/pages/components/console/ui-panel';
|
||||
|
||||
const cli = create(consolePanel);
|
||||
|
||||
moduleForAcceptance('Acceptance | settings/auth/configure/section', {
|
||||
beforeEach() {
|
||||
|
@ -37,3 +42,17 @@ test('it can save options', function(assert) {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
['aws', 'azure', 'gcp', 'github', 'kubernetes', 'ldap', 'okta', 'radius'].forEach(function(type) {
|
||||
test(`it shows tabs for auth method: ${type}`, assert => {
|
||||
let path = `${type}-${Date.now()}`;
|
||||
cli.consoleInput(`write sys/auth/${path} type=${type}`);
|
||||
cli.enter();
|
||||
indexPage.visit({ path });
|
||||
andThen(() => {
|
||||
// aws has 4 tabs, the others will have 'Configuration' and 'Method Options' tabs
|
||||
let numTabs = type === 'aws' ? 4 : 2;
|
||||
assert.equal(page.tabs.length, numTabs, 'shows correct number of tabs');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import { create, clickable, visitable } from 'ember-cli-page-object';
|
||||
import { create, clickable, visitable, collection } from 'ember-cli-page-object';
|
||||
import fields from '../../../components/form-field';
|
||||
import flashMessage from '../../../components/flash-message';
|
||||
|
||||
export default create({
|
||||
...fields,
|
||||
tabs: collection('[data-test-auth-section-tab]'),
|
||||
visit: visitable('/vault/settings/auth/configure/:path/:section'),
|
||||
flash: flashMessage,
|
||||
save: clickable('[data-test-save-config]'),
|
||||
|
|
Loading…
Reference in New Issue