diff --git a/ui/tests/integration/components/open-api-explorer/swagger-ui-test.js b/ui/tests/integration/components/open-api-explorer/swagger-ui-test.js index 2c53c0ffa1..f8da1cf33c 100644 --- a/ui/tests/integration/components/open-api-explorer/swagger-ui-test.js +++ b/ui/tests/integration/components/open-api-explorer/swagger-ui-test.js @@ -5,7 +5,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'vault/tests/helpers'; -import { waitUntil, find } from '@ember/test-helpers'; +import { waitFor } from '@ember/test-helpers'; import { setupEngine } from 'ember-engines/test-support'; import { setupMirage } from 'ember-cli-mirage/test-support'; import { render, fillIn } from '@ember/test-helpers'; @@ -13,7 +13,7 @@ import { hbs } from 'ember-cli-htmlbars'; const SELECTORS = { container: '[data-test-swagger-ui]', - searchInput: '.operation-filter-input', + searchInput: 'input.operation-filter-input', apiPathBlock: '.opblock-post', }; @@ -38,19 +38,20 @@ module('Integration | Component | open-api-explorer | swagger-ui', function (hoo }; }); - test('it renders', async function (assert) { + test(`it renders`, async function (assert) { await this.renderComponent(); - await waitUntil(() => find(SELECTORS.container)); + await waitFor(SELECTORS.container); assert.dom(SELECTORS.container).exists('renders component'); assert.dom(SELECTORS.apiPathBlock).exists({ count: this.totalApiPaths }, 'renders all api paths'); }); - test('it can search', async function (assert) { + test(`it can search`, async function (assert) { await this.renderComponent(); - await waitUntil(() => find(SELECTORS.searchInput)); + // in testing only the input is not filling correctly except after the second time + await fillIn(SELECTORS.searchInput, 'moot'); await fillIn(SELECTORS.searchInput, 'token'); // for some reason search results are not rendered immediately in tests,