2018-04-03 14:16:57 +00:00
|
|
|
import { test } from 'qunit';
|
|
|
|
import moduleForAcceptance from 'vault/tests/helpers/module-for-acceptance';
|
|
|
|
import page from 'vault/tests/pages/settings/mount-secret-backend';
|
2018-05-23 16:25:52 +00:00
|
|
|
import configPage from 'vault/tests/pages/secrets/backend/configuration';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
moduleForAcceptance('Acceptance | settings/mount-secret-backend', {
|
|
|
|
beforeEach() {
|
|
|
|
return authLogin();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
test('it sets the ttl corrects when mounting', function(assert) {
|
|
|
|
// 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;
|
|
|
|
|
2018-08-28 05:03:55 +00:00
|
|
|
page.visit();
|
|
|
|
andThen(() => {
|
|
|
|
assert.equal(currentRouteName(), 'vault.cluster.settings.mount-secret-backend');
|
|
|
|
page
|
|
|
|
.selectType('kv')
|
|
|
|
.next()
|
|
|
|
.path(path)
|
|
|
|
.toggleOptions()
|
|
|
|
.defaultTTLVal(defaultTTLHours)
|
|
|
|
.defaultTTLUnit('h')
|
|
|
|
.maxTTLVal(maxTTLHours)
|
|
|
|
.maxTTLUnit('h')
|
|
|
|
.submit();
|
|
|
|
});
|
|
|
|
andThen(() => {
|
|
|
|
configPage.visit({ backend: path });
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
andThen(() => {
|
2018-05-23 16:25:52 +00:00
|
|
|
assert.equal(configPage.defaultTTL, defaultTTLSeconds, 'shows the proper TTL');
|
|
|
|
assert.equal(configPage.maxTTL, maxTTLSeconds, 'shows the proper max TTL');
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
});
|