From b8444ce7bd392947091945e166de58710d54a8da Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Tue, 23 Apr 2019 14:19:23 +0200 Subject: [PATCH] test: test issue #117 --- src/__tests__/useQuery-test.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/__tests__/useQuery-test.tsx b/src/__tests__/useQuery-test.tsx index 5163cb3..9acf5bf 100644 --- a/src/__tests__/useQuery-test.tsx +++ b/src/__tests__/useQuery-test.tsx @@ -118,7 +118,11 @@ function Tasks({ query, ...options }: TasksProps) { return <>{error.message}; } - if (loading) { + if (loading && data.tasks) { + return <>Loading without suspense and with stale data; + } + + if (loading && !data.tasks) { return <>Loading without suspense; } @@ -325,7 +329,7 @@ it('should support updating query variables without suspense', async () => { expect(container).toMatchInlineSnapshot(`
- Loading without suspense + Loading without suspense and stale data
`);