From f5e6961bc8484c2a879f2020dc46c313a48f4202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 28 Sep 2021 14:09:12 +0200 Subject: [PATCH] slow down there fella MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../src/reader/components/useReaderState.test.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/techdocs/src/reader/components/useReaderState.test.tsx b/plugins/techdocs/src/reader/components/useReaderState.test.tsx index b0d4e0326a..cce8282b3d 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.test.tsx +++ b/plugins/techdocs/src/reader/components/useReaderState.test.tsx @@ -359,7 +359,9 @@ describe('useReaderState', () => { contentReload: expect.any(Function), }); - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'INITIAL_BUILD', @@ -496,7 +498,9 @@ describe('useReaderState', () => { }); // the new content is loaded - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'CONTENT_FRESH', path: '/example', @@ -576,7 +580,9 @@ describe('useReaderState', () => { contentReload: expect.any(Function), }); - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'CONTENT_FRESH', path: '/new',