mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 04:16:31 +02:00
UI: fix flaky openAPI explorer filter test (#26871)
* weird attempt to fix flaky test * remove for loop
This commit is contained in:
parent
d66461ef07
commit
2d5ac4b30a
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user