[APM] Fix failing ApmIndices test (#64965)

* [APM] Fix failing Indicies Settings test

* Cleanup

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Søren Louv-Jansen 2020-05-03 09:19:16 +02:00 committed by GitHub
parent 8eeaf96cf5
commit c995a333de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,15 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { render, wait } from '@testing-library/react';
import { render } from '@testing-library/react';
import React from 'react';
import { ApmIndices } from '.';
import * as hooks from '../../../../hooks/useFetcher';
import { MockApmPluginContextWrapper } from '../../../../context/ApmPluginContext/MockApmPluginContext';
describe('ApmIndices', () => {
it('should not get stuck in infinite loop', async () => {
spyOn(hooks, 'useFetcher').and.returnValue({
it('should not get stuck in infinite loop', () => {
const spy = spyOn(hooks, 'useFetcher').and.returnValue({
data: undefined,
status: 'loading'
});
@ -30,6 +30,6 @@ describe('ApmIndices', () => {
</h2>
`);
await wait();
expect(spy).toHaveBeenCalledTimes(2);
});
});