Fixes some flaky enterprise tests (#13483)

* fixes some flaky enterprise tests

* more test fixes
This commit is contained in:
Jordan Reimer 2021-12-20 17:00:04 -07:00 committed by GitHub
parent 82f333002a
commit e85158e017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { settled, currentURL, currentRouteName, visit } from '@ember/test-helpers'; import { settled, currentURL, currentRouteName, visit, waitUntil } from '@ember/test-helpers';
import { module, test, skip } from 'qunit'; import { module, test, skip } from 'qunit';
import { setupApplicationTest } from 'ember-qunit'; import { setupApplicationTest } from 'ember-qunit';
import { create } from 'ember-cli-page-object'; import { create } from 'ember-cli-page-object';
@ -130,9 +130,8 @@ module('Acceptance | Enterprise | control groups', function (hooks) {
await settled(); await settled();
await visit('/vault/secrets/kv-v2-mount/show/foo'); await visit('/vault/secrets/kv-v2-mount/show/foo');
assert.equal( assert.ok(
currentRouteName(), await waitUntil(() => currentRouteName() === 'vault.cluster.access.control-group-accessor'),
'vault.cluster.access.control-group-accessor',
'redirects to access control group route' 'redirects to access control group route'
); );
}); });

View File

@ -130,6 +130,7 @@ module('Acceptance | Enterprise | replication', function (hooks) {
await click('#no-filtering'); await click('#no-filtering');
await click('[data-test-config-save]'); await click('[data-test-config-save]');
await settled(); // eslint-disable-line
assert.equal( assert.equal(
flash.latestMessage, flash.latestMessage,
@ -234,7 +235,7 @@ module('Acceptance | Enterprise | replication', function (hooks) {
await fillIn('[data-test-replication-cluster-mode-select]', 'primary'); await fillIn('[data-test-replication-cluster-mode-select]', 'primary');
await click('[data-test-replication-enable]'); await click('[data-test-replication-enable]');
await settled(); // eslint-disable-line
await pollCluster(this.owner); await pollCluster(this.owner);
await visit('/vault/replication-dr-promote/details'); await visit('/vault/replication-dr-promote/details');

View File

@ -86,7 +86,10 @@ module('Acceptance | ssh secret backend', function (hooks) {
// default has generate CA checked so we just submit the form // default has generate CA checked so we just submit the form
await click('[data-test-ssh-input="configure-submit"]'); await click('[data-test-ssh-input="configure-submit"]');
assert.ok(findAll('[data-test-ssh-input="public-key"]').length, 'a public key is fetched'); assert.ok(
await waitUntil(() => findAll('[data-test-ssh-input="public-key"]').length),
'a public key is fetched'
);
await click('[data-test-backend-view-link]'); await click('[data-test-backend-view-link]');
assert.equal(currentURL(), `/vault/secrets/${sshPath}/list`, `redirects to ssh index`); assert.equal(currentURL(), `/vault/secrets/${sshPath}/list`, `redirects to ssh index`);