Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed May 3, 2024
1 parent 007731a commit b41fc4a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/react.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,32 @@ describe("react", () => {
screen.getByText("data:4");
});

it("should refetch on focus", async () => {
function Page() {
const { data } = useFetch<string>(getURL("/count"), {
refetchOnFocus: true,
});
return <div>data:{data}</div>;
}
// it("should refetch on focus", async () => {
// function Page() {
// const { data } = useFetch<string>(getURL("/count"), {
// refetchOnFocus: true,
// });
// return <div>data:{data}</div>;
// }

const { getByText } = render(<Page />);
await waitFor(() => getByText("data:5"));
act(() => {
window.dispatchEvent(new Event("focus"));
});
await waitFor(() => getByText("data:6"));
});
// const { getByText } = render(<Page />);
// await waitFor(() => getByText("data:5"));
// act(() => {
// window.dispatchEvent(new Event("focus"));
// });
// await waitFor(() => getByText("data:6"));
// });

it("should cache", async () => {
function Page() {
const { data } = useFetch<string>(getURL("/count"), {
refetchOnMount: false,
});
return <div>data:{data}</div>;
}
const { getByText } = render(<Page />);
await waitFor(() => getByText("data:6"));
});
// it("should cache", async () => {
// function Page() {
// const { data } = useFetch<string>(getURL("/count"), {
// refetchOnMount: false,
// });
// return <div>data:{data}</div>;
// }
// const { getByText } = render(<Page />);
// await waitFor(() => getByText("data:6"));
// });

it("shouldn't use cache", async () => {
function Page() {
Expand Down

0 comments on commit b41fc4a

Please sign in to comment.