open-vault/ui/tests/acceptance/settings/configure-secret-backends/pki/section-tidy-test.js
Matthew Irish b32da5daad
use ember-concurrency test waiter (#6555)
* add ember-concurrency-test-waiter

* use withTestWaiter modifier in various parts of the application

* more withTestWaiter

* await instead of return for a few helpers

* update ember-cli-flash

* run ember generate ember-cli-flash

* remove withFlash helper

* fix typo and replication tests
2019-04-10 09:36:32 -05:00

26 lines
1,015 B
JavaScript

import { currentRouteName } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import page from 'vault/tests/pages/settings/configure-secret-backends/pki/section';
import authPage from 'vault/tests/pages/auth';
import enablePage from 'vault/tests/pages/settings/mount-secret-backend';
module('Acceptance | settings/configure/secrets/pki/tidy', function(hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(function() {
return authPage.login();
});
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();
await page.form.submit();
assert.equal(page.lastMessage, 'The tidy config for this backend has been updated.');
});
});