2018-09-25 16:28:26 +00:00
|
|
|
import { currentRouteName } from '@ember/test-helpers';
|
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupApplicationTest } from 'ember-qunit';
|
2018-04-03 14:16:57 +00:00
|
|
|
import page from 'vault/tests/pages/settings/auth/enable';
|
|
|
|
import listPage from 'vault/tests/pages/access/methods';
|
2018-09-25 16:28:26 +00:00
|
|
|
import authPage from 'vault/tests/pages/auth';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
module('Acceptance | settings/auth/enable', function(hooks) {
|
|
|
|
setupApplicationTest(hooks);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
hooks.beforeEach(function() {
|
|
|
|
return authPage.login();
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
2018-09-25 16:28:26 +00:00
|
|
|
|
|
|
|
test('it mounts and redirects', async function(assert) {
|
|
|
|
// always force the new mount to the top of the list
|
|
|
|
const path = `approle-${new Date().getTime()}`;
|
|
|
|
const type = 'approle';
|
|
|
|
await page.visit();
|
|
|
|
assert.equal(currentRouteName(), 'vault.cluster.settings.auth.enable');
|
2019-04-10 14:36:32 +00:00
|
|
|
await page.enable(type, path);
|
|
|
|
assert.equal(
|
|
|
|
page.flash.latestMessage,
|
|
|
|
`Successfully mounted the ${type} auth method at ${path}.`,
|
|
|
|
'success flash shows'
|
|
|
|
);
|
2018-04-03 14:16:57 +00:00
|
|
|
assert.equal(
|
|
|
|
currentRouteName(),
|
2019-02-14 18:52:34 +00:00
|
|
|
'vault.cluster.settings.auth.configure.section',
|
|
|
|
'redirects to the auth config page'
|
2018-04-03 14:16:57 +00:00
|
|
|
);
|
2019-02-14 18:52:34 +00:00
|
|
|
|
|
|
|
await listPage.visit();
|
2018-09-25 16:28:26 +00:00
|
|
|
assert.ok(listPage.findLinkById(path), 'mount is present in the list');
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
});
|