fix flaky clients current test (#14471)
This commit is contained in:
parent
ec4d013047
commit
8844895745
|
@ -1,5 +1,5 @@
|
||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { visit, currentURL, settled, click } from '@ember/test-helpers';
|
import { visit, currentURL, settled, click, waitUntil, find } from '@ember/test-helpers';
|
||||||
import { setupApplicationTest } from 'ember-qunit';
|
import { setupApplicationTest } from 'ember-qunit';
|
||||||
import Pretender from 'pretender';
|
import Pretender from 'pretender';
|
||||||
import authPage from 'vault/tests/pages/auth';
|
import authPage from 'vault/tests/pages/auth';
|
||||||
|
@ -99,13 +99,18 @@ module('Acceptance | clients current', function (hooks) {
|
||||||
// Filter by auth method
|
// Filter by auth method
|
||||||
await clickTrigger();
|
await clickTrigger();
|
||||||
await searchSelect.options.objectAt(0).click();
|
await searchSelect.options.objectAt(0).click();
|
||||||
await settled();
|
await waitUntil(() => {
|
||||||
|
return find('#auth-method-search-select');
|
||||||
|
});
|
||||||
assert.dom('[data-test-stat-text="total-clients"] .stat-value').hasText('5');
|
assert.dom('[data-test-stat-text="total-clients"] .stat-value').hasText('5');
|
||||||
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('3');
|
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('3');
|
||||||
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('2');
|
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('2');
|
||||||
assert.dom(SELECTORS.attributionBlock).doesNotExist('Does not show attribution block');
|
assert.dom(SELECTORS.attributionBlock).doesNotExist('Does not show attribution block');
|
||||||
// Delete auth filter goes back to filtered only on namespace
|
// Delete auth filter goes back to filtered only on namespace
|
||||||
await click('#auth-method-search-select [data-test-selected-list-button="delete"]');
|
await click('#auth-method-search-select [data-test-selected-list-button="delete"]');
|
||||||
|
await waitUntil(() => {
|
||||||
|
return find('[data-test-horizontal-bar-chart]');
|
||||||
|
});
|
||||||
assert.dom('[data-test-stat-text="total-clients"] .stat-value').hasText('15');
|
assert.dom('[data-test-stat-text="total-clients"] .stat-value').hasText('15');
|
||||||
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('5');
|
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('5');
|
||||||
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');
|
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');
|
||||||
|
|
Loading…
Reference in New Issue