Skip to content

Commit

Permalink
[APM] Disable flaky useFetcher test (elastic#70638) (elastic#70654)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Jul 3, 2020
1 parent 7759b92 commit 203ae27
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,29 @@ describe.skip('useFetcher', () => {
expect(hook.result.current).toEqual(true);
});

it('is true for minimum 1000ms', () => {
hook = renderHook((isLoading) => useDelayedVisibility(isLoading), {
initialProps: false,
});
// Disabled because it's flaky: https://github.com/elastic/kibana/issues/66389
// it('is true for minimum 1000ms', () => {
// hook = renderHook((isLoading) => useDelayedVisibility(isLoading), {
// initialProps: false,
// });

hook.rerender(true);
// hook.rerender(true);

act(() => {
jest.advanceTimersByTime(100);
});
// act(() => {
// jest.advanceTimersByTime(100);
// });

hook.rerender(false);
act(() => {
jest.advanceTimersByTime(900);
});
// hook.rerender(false);
// act(() => {
// jest.advanceTimersByTime(900);
// });

expect(hook.result.current).toEqual(true);
// expect(hook.result.current).toEqual(true);

act(() => {
jest.advanceTimersByTime(100);
});
// act(() => {
// jest.advanceTimersByTime(100);
// });

expect(hook.result.current).toEqual(false);
});
// expect(hook.result.current).toEqual(false);
// });
});

0 comments on commit 203ae27

Please sign in to comment.