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

35 lines
1 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 page from 'vault/tests/pages/settings/auth/enable';
import listPage from 'vault/tests/pages/access/methods';
moduleForAcceptance('Acceptance | settings/auth/enable', {
beforeEach() {
return authLogin();
},
});
test('it mounts and redirects', function(assert) {
2018-08-28 05:03:55 +00:00
// always force the new mount to the top of the list
const path = `approle-${new Date().getTime()}`;
const type = 'approle';
2018-04-03 14:16:57 +00:00
page.visit();
andThen(() => {
assert.equal(currentRouteName(), 'vault.cluster.settings.auth.enable');
2018-08-28 05:03:55 +00:00
page.form.mount(type, path);
2018-04-03 14:16:57 +00:00
});
andThen(() => {
assert.equal(
page.flash.latestMessage,
`Successfully mounted ${type} auth method at ${path}.`,
'success flash shows'
);
assert.equal(
currentRouteName(),
'vault.cluster.access.methods',
'redirects to the auth backend list page'
);
assert.ok(listPage.backendLinks().findById(path), 'mount is present in the list');
});
});