Skip to content

Commit

Permalink
[APM] Fix failing ApmIndices test (#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 authored May 3, 2020
1 parent 8eeaf96 commit c995a33
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 c995a33

Please sign in to comment.