fix flaky clients current test (#14471)

This commit is contained in:
claire bontempo 2022-03-11 13:52:02 -08:00 committed by GitHub
parent ec4d013047
commit 8844895745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
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 Pretender from 'pretender';
import authPage from 'vault/tests/pages/auth';
@ -99,13 +99,18 @@ module('Acceptance | clients current', function (hooks) {
// Filter by auth method
await clickTrigger();
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="entity-clients"] .stat-value').hasText('3');
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('2');
assert.dom(SELECTORS.attributionBlock).doesNotExist('Does not show attribution block');
// Delete auth filter goes back to filtered only on namespace
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="entity-clients"] .stat-value').hasText('5');
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');