Skip to content

Commit

Permalink
Update failing tests in useQueryRefHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Mar 19, 2024
1 parent e562b3c commit 391cb94
Showing 1 changed file with 60 additions and 5 deletions.
65 changes: 60 additions & 5 deletions src/react/hooks/__tests__/useQueryRefHandlers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,18 @@ test("resuspends when calling `fetchMore`", async () => {

const user = userEvent.setup();

const client = new ApolloClient({ cache: new InMemoryCache(), link });
const client = new ApolloClient({
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
letters: { keyArgs: false },
},
},
},
}),
link,
});
const preloadQuery = createQueryPreloader(client);

const Profiler = createProfiler({
Expand Down Expand Up @@ -1397,7 +1408,18 @@ test("paginates from queryRefs produced by useBackgroundQuery", async () => {
const { query, link } = setupPaginatedCase();

const user = userEvent.setup();
const client = new ApolloClient({ cache: new InMemoryCache(), link });
const client = new ApolloClient({
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
letters: { keyArgs: false },
},
},
},
}),
link,
});

const Profiler = createProfiler({
initialSnapshot: {
Expand Down Expand Up @@ -1489,7 +1511,18 @@ test("paginates from queryRefs produced by useLoadableQuery", async () => {
const { query, link } = setupPaginatedCase();

const user = userEvent.setup();
const client = new ApolloClient({ cache: new InMemoryCache(), link });
const client = new ApolloClient({
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
letters: { keyArgs: false },
},
},
},
}),
link,
});

const Profiler = createProfiler({
initialSnapshot: {
Expand Down Expand Up @@ -1589,7 +1622,18 @@ test("`fetchMore` works with startTransition", async () => {
const { query, link } = setupPaginatedCase();

const user = userEvent.setup();
const client = new ApolloClient({ cache: new InMemoryCache(), link });
const client = new ApolloClient({
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
letters: { keyArgs: false },
},
},
},
}),
link,
});
const preloadQuery = createQueryPreloader(client);

const Profiler = createProfiler({
Expand Down Expand Up @@ -1708,7 +1752,18 @@ test("`fetchMore` works with startTransition from useBackgroundQuery and useQuer
const { query, link } = setupPaginatedCase();

const user = userEvent.setup();
const client = new ApolloClient({ cache: new InMemoryCache(), link });
const client = new ApolloClient({
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
letters: { keyArgs: false },
},
},
},
}),
link,
});

const Profiler = createProfiler({
initialSnapshot: {
Expand Down

0 comments on commit 391cb94

Please sign in to comment.