Skip to content

Commit

Permalink
Remove part of test that performs refetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Feb 12, 2024
1 parent 1ca66c6 commit 1d7629d
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/react/hooks/__tests__/useQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4215,45 +4215,6 @@ describe("useQuery Hook", () => {
});
}

// Since we write data to the cache that does not contain all the data to
// fulfill the first query, it will try and fetch again
{
const { snapshot } = await Profiler.takeRender();

expect(snapshot.useQueryResult).toMatchObject({
data: undefined,
loading: true,
networkStatus: NetworkStatus.loading,
});

expect(snapshot.useLazyQueryResult).toMatchObject({
called: true,
data: { person: { __typename: "Person", id: 1, lastName: "Doe" } },
loading: false,
networkStatus: NetworkStatus.ready,
});
}

{
const { snapshot } = await Profiler.takeRender();

expect(snapshot.useQueryResult).toMatchObject({
data: undefined,
error: new ApolloError({
graphQLErrors: [new GraphQLError("Intentional error")],
}),
loading: false,
networkStatus: NetworkStatus.error,
});

expect(snapshot.useLazyQueryResult).toMatchObject({
called: true,
data: { person: { __typename: "Person", id: 1, lastName: "Doe" } },
loading: false,
networkStatus: NetworkStatus.ready,
});
}

await expect(Profiler).not.toRerender();
});

Expand Down

0 comments on commit 1d7629d

Please sign in to comment.