Skip to content

Commit db222f4

Browse files
committed
Revert "Remove await nextTick, which was causing flakiness."
This reverts commit 8ee1674.
1 parent 8ee1674 commit db222f4

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
76
import { act } from 'react-dom/test-utils';
87

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

1817
describe('<RemoteClusterList />', () => {
19-
const { server, httpRequestsMockHelpers } = setupEnvironment();
18+
let server;
19+
let httpRequestsMockHelpers;
20+
21+
beforeAll(() => {
22+
({ server, httpRequestsMockHelpers } = setupEnvironment());
23+
});
2024

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

4145
describe('when there are no remote clusters', () => {
42-
let waitFor;
4346
let exists;
47+
let component;
4448

4549
beforeEach(async () => {
46-
({ waitFor, exists } = setup());
50+
({ exists, component } = setup());
4751

48-
await waitFor('remoteClusterListEmptyPrompt');
52+
// await nextTick(100); // We need to wait next tick for the mock server response to kick in
53+
component.update();
4954
});
5055

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

0 commit comments

Comments
 (0)