From 8844895745b9fd8f68eebb0e98744c24bbb7704a Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Fri, 11 Mar 2022 13:52:02 -0800 Subject: [PATCH] fix flaky clients current test (#14471) --- ui/tests/acceptance/client-current-test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/tests/acceptance/client-current-test.js b/ui/tests/acceptance/client-current-test.js index 981014857..987bc970c 100644 --- a/ui/tests/acceptance/client-current-test.js +++ b/ui/tests/acceptance/client-current-test.js @@ -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');