Skip to content

Commit

Permalink
Remove unused variables and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Nov 10, 2023
1 parent 5e4c259 commit 9ec3330
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions src/react/hooks/__tests__/useInteractiveQuery.test.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
import React, { Fragment, StrictMode, Suspense, useState } from "react";
import React, { Suspense, useState } from "react";
import {
act,
render,
screen,
renderHook,
RenderHookOptions,
waitFor,
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import type { Options as UserEventOptions } from "@testing-library/user-event";
import {
ErrorBoundary,
ErrorBoundary as ReactErrorBoundary,
ErrorBoundaryProps,
} from "react-error-boundary";
import { ErrorBoundary as ReactErrorBoundary } from "react-error-boundary";
import { expectTypeOf } from "expect-type";
import { GraphQLError } from "graphql";
import {
gql,
ApolloError,
DocumentNode,
ApolloClient,
ErrorPolicy,
NormalizedCacheObject,
NetworkStatus,
ApolloCache,
TypedDocumentNode,
ApolloLink,
Observable,
FetchMoreQueryOptions,
OperationVariables,
ApolloQueryResult,
} from "../../../core";
import {
MockedProvider,
Expand All @@ -50,10 +39,7 @@ import { useReadQuery } from "../useReadQuery";
import { ApolloProvider } from "../../context";
import { InMemoryCache } from "../../../cache";
import { QueryReference } from "../../../react";
import {
InteractiveQueryHookOptions,
InteractiveQueryHookFetchPolicy,
} from "../../types/types";
import { InteractiveQueryHookFetchPolicy } from "../../types/types";
import { FetchMoreFunction, RefetchFunction } from "../useSuspenseQuery";
import { RefetchWritePolicy } from "../../../core/watchQueryOptions";
import invariant from "ts-invariant";
Expand Down Expand Up @@ -2235,7 +2221,7 @@ it('returns errors after calling `refetch` when errorPolicy is set to "all"', as
},
];

const { SuspenseFallback, ReadQueryHook, ErrorBoundary, ErrorFallback } =
const { SuspenseFallback, ReadQueryHook, ErrorBoundary } =
createDefaultProfiledComponents<VariablesCaseData | undefined>();

function App() {
Expand Down Expand Up @@ -2297,7 +2283,7 @@ it('handles partial data results after calling `refetch` when errorPolicy is set
},
];

const { SuspenseFallback, ReadQueryHook, ErrorBoundary, ErrorFallback } =
const { SuspenseFallback, ReadQueryHook, ErrorBoundary } =
createDefaultProfiledComponents<VariablesCaseData | undefined>();

function App() {
Expand Down Expand Up @@ -2378,11 +2364,6 @@ it("`refetch` works with startTransition to allow React to show stale UI until f
},
];

const client = new ApolloClient({
link: new MockLink(mocks),
cache: new InMemoryCache(),
});

function SuspenseFallback() {
return <p>Loading</p>;
}
Expand Down Expand Up @@ -3382,7 +3363,7 @@ it('suspends when partial data is in the cache and using a "no-cache" fetch poli
});

it('warns when using returnPartialData with a "no-cache" fetch policy', async () => {
using consoleSpy = spyOnConsole("warn");
using _consoleSpy = spyOnConsole("warn");

const query: TypedDocumentNode<SimpleQueryData> = gql`
query UserQuery {
Expand Down Expand Up @@ -3514,7 +3495,7 @@ it('suspends and does not use partial data when changing variables and using a "
});

const { SuspenseFallback, ReadQueryHook } =
createDefaultProfiledComponents<DeepPartial<Data>>();
createDefaultProfiledComponents<DeepPartial<VariablesCaseData>>();

function App() {
const [queryRef, loadQuery] = useInteractiveQuery(query, {
Expand Down Expand Up @@ -3721,7 +3702,7 @@ describe.skip("type tests", () => {
it("returns unknown when TData cannot be inferred", () => {
const query = gql``;

const [queryRef, loadQuery] = useInteractiveQuery(query);
const [queryRef] = useInteractiveQuery(query);

invariant(queryRef);

Expand Down

0 comments on commit 9ec3330

Please sign in to comment.