Skip to content

Commit d4467a7

Browse files
[APM] Fix failing ApmIndices test (#64965) (#65023)
* [APM] Fix failing Indicies Settings test * Cleanup Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent d1e17d8 commit d4467a7

File tree

1 file changed

+4
-4
lines changed
  • x-pack/plugins/apm/public/components/app/Settings/ApmIndices

1 file changed

+4
-4
lines changed

x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import { render, wait } from '@testing-library/react';
7+
import { render } from '@testing-library/react';
88
import React from 'react';
99
import { ApmIndices } from '.';
1010
import * as hooks from '../../../../hooks/useFetcher';
1111
import { MockApmPluginContextWrapper } from '../../../../context/ApmPluginContext/MockApmPluginContext';
1212

1313
describe('ApmIndices', () => {
14-
it('should not get stuck in infinite loop', async () => {
15-
spyOn(hooks, 'useFetcher').and.returnValue({
14+
it('should not get stuck in infinite loop', () => {
15+
const spy = spyOn(hooks, 'useFetcher').and.returnValue({
1616
data: undefined,
1717
status: 'loading'
1818
});
@@ -30,6 +30,6 @@ describe('ApmIndices', () => {
3030
</h2>
3131
`);
3232

33-
await wait();
33+
expect(spy).toHaveBeenCalledTimes(2);
3434
});
3535
});

0 commit comments

Comments
 (0)