@@ -9,7 +9,6 @@ import React from 'react';
99import { MemoryRouter } from 'react-router-dom' ;
1010
1111import '../../common/mock/match_media' ;
12- import { waitForUpdates } from '../../common/utils/test_utils' ;
1312import { TestProviders } from '../../common/mock' ;
1413import { useWithSource } from '../../common/containers/source' ;
1514import {
@@ -65,31 +64,29 @@ describe('Overview', () => {
6564 mockuseMessagesStorage . mockImplementation ( ( ) => endpointNoticeMessage ( false ) ) ;
6665 } ) ;
6766
68- it ( 'renders the Setup Instructions text' , async ( ) => {
67+ it ( 'renders the Setup Instructions text' , ( ) => {
6968 const wrapper = mount (
7069 < TestProviders >
7170 < MemoryRouter >
7271 < Overview />
7372 </ MemoryRouter >
7473 </ TestProviders >
7574 ) ;
76- await waitForUpdates ( wrapper ) ;
7775 expect ( wrapper . find ( '[data-test-subj="empty-page"]' ) . exists ( ) ) . toBe ( true ) ;
7876 } ) ;
7977
80- it ( 'does not show Endpoint get ready button when ingest is not enabled' , async ( ) => {
78+ it ( 'does not show Endpoint get ready button when ingest is not enabled' , ( ) => {
8179 const wrapper = mount (
8280 < TestProviders >
8381 < MemoryRouter >
8482 < Overview />
8583 </ MemoryRouter >
8684 </ TestProviders >
8785 ) ;
88- await waitForUpdates ( wrapper ) ;
8986 expect ( wrapper . find ( '[data-test-subj="empty-page-secondary-action"]' ) . exists ( ) ) . toBe ( false ) ;
9087 } ) ;
9188
92- it ( 'shows Endpoint get ready button when ingest is enabled' , async ( ) => {
89+ it ( 'shows Endpoint get ready button when ingest is enabled' , ( ) => {
9390 ( useIngestEnabledCheck as jest . Mock ) . mockReturnValue ( { allEnabled : true } ) ;
9491 const wrapper = mount (
9592 < TestProviders >
@@ -98,12 +95,11 @@ describe('Overview', () => {
9895 </ MemoryRouter >
9996 </ TestProviders >
10097 ) ;
101- await waitForUpdates ( wrapper ) ;
10298 expect ( wrapper . find ( '[data-test-subj="empty-page-secondary-action"]' ) . exists ( ) ) . toBe ( true ) ;
10399 } ) ;
104100 } ) ;
105101
106- it ( 'it DOES NOT render the Getting started text when an index is available' , async ( ) => {
102+ it ( 'it DOES NOT render the Getting started text when an index is available' , ( ) => {
107103 ( useWithSource as jest . Mock ) . mockReturnValue ( {
108104 indicesExist : true ,
109105 indexPattern : { } ,
@@ -120,12 +116,12 @@ describe('Overview', () => {
120116 </ MemoryRouter >
121117 </ TestProviders >
122118 ) ;
123- await waitForUpdates ( wrapper ) ;
124119
125120 expect ( wrapper . find ( '[data-test-subj="empty-page"]' ) . exists ( ) ) . toBe ( false ) ;
121+ wrapper . unmount ( ) ;
126122 } ) ;
127123
128- test ( 'it DOES render the Endpoint banner when the endpoint index is NOT available AND storage is NOT set' , async ( ) => {
124+ test ( 'it DOES render the Endpoint banner when the endpoint index is NOT available AND storage is NOT set' , ( ) => {
129125 ( useWithSource as jest . Mock ) . mockReturnValueOnce ( {
130126 indicesExist : true ,
131127 indexPattern : { } ,
@@ -147,12 +143,12 @@ describe('Overview', () => {
147143 </ MemoryRouter >
148144 </ TestProviders >
149145 ) ;
150- await waitForUpdates ( wrapper ) ;
151146
152147 expect ( wrapper . find ( '[data-test-subj="endpoint-prompt-banner"]' ) . exists ( ) ) . toBe ( true ) ;
148+ wrapper . unmount ( ) ;
153149 } ) ;
154150
155- test ( 'it does NOT render the Endpoint banner when the endpoint index is NOT available but storage is set' , async ( ) => {
151+ test ( 'it does NOT render the Endpoint banner when the endpoint index is NOT available but storage is set' , ( ) => {
156152 ( useWithSource as jest . Mock ) . mockReturnValueOnce ( {
157153 indicesExist : true ,
158154 indexPattern : { } ,
@@ -174,12 +170,12 @@ describe('Overview', () => {
174170 </ MemoryRouter >
175171 </ TestProviders >
176172 ) ;
177- await waitForUpdates ( wrapper ) ;
178173
179174 expect ( wrapper . find ( '[data-test-subj="endpoint-prompt-banner"]' ) . exists ( ) ) . toBe ( false ) ;
175+ wrapper . unmount ( ) ;
180176 } ) ;
181177
182- test ( 'it does NOT render the Endpoint banner when the endpoint index is available AND storage is set' , async ( ) => {
178+ test ( 'it does NOT render the Endpoint banner when the endpoint index is available AND storage is set' , ( ) => {
183179 ( useWithSource as jest . Mock ) . mockReturnValue ( {
184180 indicesExist : true ,
185181 indexPattern : { } ,
@@ -196,12 +192,12 @@ describe('Overview', () => {
196192 </ MemoryRouter >
197193 </ TestProviders >
198194 ) ;
199- await waitForUpdates ( wrapper ) ;
200195
201196 expect ( wrapper . find ( '[data-test-subj="endpoint-prompt-banner"]' ) . exists ( ) ) . toBe ( false ) ;
197+ wrapper . unmount ( ) ;
202198 } ) ;
203199
204- test ( 'it does NOT render the Endpoint banner when an index IS available but storage is NOT set' , async ( ) => {
200+ test ( 'it does NOT render the Endpoint banner when an index IS available but storage is NOT set' , ( ) => {
205201 ( useWithSource as jest . Mock ) . mockReturnValue ( {
206202 indicesExist : true ,
207203 indexPattern : { } ,
@@ -219,9 +215,10 @@ describe('Overview', () => {
219215 </ TestProviders >
220216 ) ;
221217 expect ( wrapper . find ( '[data-test-subj="endpoint-prompt-banner"]' ) . exists ( ) ) . toBe ( false ) ;
218+ wrapper . unmount ( ) ;
222219 } ) ;
223220
224- test ( 'it does NOT render the Endpoint banner when Ingest is NOT available' , async ( ) => {
221+ test ( 'it does NOT render the Endpoint banner when Ingest is NOT available' , ( ) => {
225222 ( useWithSource as jest . Mock ) . mockReturnValue ( {
226223 indicesExist : true ,
227224 indexPattern : { } ,
@@ -238,9 +235,9 @@ describe('Overview', () => {
238235 </ MemoryRouter >
239236 </ TestProviders >
240237 ) ;
241- await waitForUpdates ( wrapper ) ;
242238
243239 expect ( wrapper . find ( '[data-test-subj="endpoint-prompt-banner"]' ) . exists ( ) ) . toBe ( false ) ;
240+ wrapper . unmount ( ) ;
244241 } ) ;
245242 } ) ;
246243} ) ;
0 commit comments