open-vault/ui/tests/acceptance/settings-test.js

53 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import { test } from 'qunit';
import moduleForAcceptance from 'vault/tests/helpers/module-for-acceptance';
import backendListPage from 'vault/tests/pages/secrets/backends';
2018-08-28 05:03:55 +00:00
import mountSecrets from 'vault/tests/pages/settings/mount-secret-backend';
2018-04-03 14:16:57 +00:00
moduleForAcceptance('Acceptance | settings', {
beforeEach() {
return authLogin();
},
afterEach() {
return authLogout();
},
});
test('settings', function(assert) {
const now = new Date().getTime();
const type = 'consul';
const path = `path-${now}`;
// mount unsupported backend
visit('/vault/settings/mount-secret-backend');
andThen(function() {
assert.equal(currentURL(), '/vault/settings/mount-secret-backend');
2018-08-28 05:03:55 +00:00
mountSecrets
.selectType(type)
.next()
.path(path)
.toggleOptions()
.defaultTTLVal(100)
.defaultTTLUnit('s')
.submit();
});
2018-04-03 14:16:57 +00:00
andThen(() => {
assert.equal(currentURL(), `/vault/secrets`, 'redirects to secrets page');
assert.ok(
find('[data-test-flash-message]').text().trim(),
`Successfully mounted '${type}' at '${path}'!`
);
let row = backendListPage.rows().findByPath(path);
row.menu();
});
andThen(() => {
backendListPage.configLink();
2018-04-03 14:16:57 +00:00
});
andThen(() => {
assert.ok(currentURL(), '/vault/secrets/${path}/configuration', 'navigates to the config page');
2018-04-03 14:16:57 +00:00
});
});