Skip to content

Commit

Permalink
[APM] Fix failing ApmIndices test (elastic#64965)
Browse files Browse the repository at this point in the history
* [APM] Fix failing Indicies Settings test

* Cleanup

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
sorenlouv and elasticmachine committed May 3, 2020
1 parent d1e17d8 commit 1afccef
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
Expand All @@ -30,6 +30,6 @@ describe('ApmIndices', () => {
</h2>
`);

await wait();
expect(spy).toHaveBeenCalledTimes(2);
});
});

0 comments on commit 1afccef

Please sign in to comment.