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/configure-secret-backends/pki/section';
|
2018-09-25 16:28:26 +00:00
|
|
|
import authPage from 'vault/tests/pages/auth';
|
|
|
|
import enablePage from 'vault/tests/pages/settings/mount-secret-backend';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
module('Acceptance | settings/configure/secrets/pki/tidy', 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 saves tidy config', async function(assert) {
|
|
|
|
const path = `pki-${new Date().getTime()}`;
|
|
|
|
await enablePage.enable('pki', path);
|
|
|
|
await page.visit({ backend: path, section: 'tidy' });
|
|
|
|
assert.equal(currentRouteName(), 'vault.cluster.settings.configure-secret-backend.section');
|
|
|
|
await page.form.fields.objectAt(0).clickLabel();
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2019-04-10 14:36:32 +00:00
|
|
|
await page.form.submit();
|
|
|
|
assert.equal(page.lastMessage, 'The tidy config for this backend has been updated.');
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
});
|