Commit 333bee43 authored by Simon Knox's avatar Simon Knox

Merge branch '328718-fix-flaky-spec' into 'master'

Fix flaky spec in users_select/index_spec

See merge request gitlab-org/gitlab!60478
parents db4b563b 6e60f9fd
import { waitFor } from '@testing-library/dom';
import MockAdapter from 'axios-mock-adapter';
import { memoize, cloneDeep } from 'lodash';
import { getFixture, getJSONFixture } from 'helpers/fixtures';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
import UsersSelect from '~/users_select';
......@@ -103,8 +103,10 @@ export const setAssignees = (...users) => {
);
};
export const toggleDropdown = () => findUserSearchButton().click();
export const waitForDropdownItems = () =>
waitFor(() => expect(findDropdownItem(getUsersFixtureAt(0))).not.toBeNull());
export const waitForDropdownItems = async () => {
await axios.waitForAll();
await waitForPromises();
};
// assertion helpers ---------------------------------------------------------
export const createUnassignedExpectation = () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment