open-vault/ui/tests/acceptance/settings/mount-secret-backend-test.js
Matthew Irish 23778935b0
UI - make engine list more consistent with the auth method list (#4598)
* remove expanding behavior from engines list and add a configuration route

* use page header component, secret tab component for the template on the secret engine configuration route

* move abstraction to secret-list-header and remove secret-tabs

* add attrs to secret engine model and adjust mount controller code to support that

* fix top level nav so that we can use the back button properly

* fix tests
2018-05-23 11:25:52 -05:00

39 lines
1.2 KiB
JavaScript

import { test } from 'qunit';
import moduleForAcceptance from 'vault/tests/helpers/module-for-acceptance';
import page from 'vault/tests/pages/settings/mount-secret-backend';
import configPage from 'vault/tests/pages/secrets/backend/configuration';
moduleForAcceptance('Acceptance | settings/mount-secret-backend', {
beforeEach() {
return authLogin();
},
});
test('it sets the ttl corrects when mounting', function(assert) {
page.visit();
andThen(() => {
assert.equal(currentRouteName(), 'vault.cluster.settings.mount-secret-backend');
});
// always force the new mount to the top of the list
const path = `kv-${new Date().getTime()}`;
const defaultTTLHours = 100;
const maxTTLHours = 300;
const defaultTTLSeconds = defaultTTLHours * 60 * 60;
const maxTTLSeconds = maxTTLHours * 60 * 60;
page
.type('kv')
.path(path)
.toggleOptions()
.defaultTTLVal(defaultTTLHours)
.defaultTTLUnit('h')
.maxTTLVal(maxTTLHours)
.maxTTLUnit('h')
.submit();
configPage.visit({backend: path});
andThen(() => {
assert.equal(configPage.defaultTTL, defaultTTLSeconds, 'shows the proper TTL');
assert.equal(configPage.maxTTL, maxTTLSeconds, 'shows the proper max TTL');
});
});