Skip to content

Commit

Permalink
Revert "Remove await nextTick, which was causing flakiness."
Browse files Browse the repository at this point in the history
This reverts commit 8ee1674.
  • Loading branch information
cjcenizal committed Nov 3, 2020
1 parent 8ee1674 commit db222f4
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { act } from 'react-dom/test-utils';

import { getRouter } from '../../../public/application/services';
Expand All @@ -16,7 +15,12 @@ import { setupEnvironment, nextTick, getRandomString, findTestSubject } from '..
import { setup } from './remote_clusters_list.helpers';

describe('<RemoteClusterList />', () => {
const { server, httpRequestsMockHelpers } = setupEnvironment();
let server;
let httpRequestsMockHelpers;

beforeAll(() => {
({ server, httpRequestsMockHelpers } = setupEnvironment());
});

afterAll(() => {
server.restore();
Expand All @@ -39,13 +43,14 @@ describe('<RemoteClusterList />', () => {
});

describe('when there are no remote clusters', () => {
let waitFor;
let exists;
let component;

beforeEach(async () => {
({ waitFor, exists } = setup());
({ exists, component } = setup());

await waitFor('remoteClusterListEmptyPrompt');
// await nextTick(100); // We need to wait next tick for the mock server response to kick in
component.update();
});

test('should display an empty prompt', async () => {
Expand Down

0 comments on commit db222f4

Please sign in to comment.