import { render, screen } from "@testing-library/react";
import React, { useState } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const queryClient = new QueryClient();

describe("Minimal render test", () => {
  it("renders a simple component without error", () => {
    function SimpleComponent() {
      const [count, setCount] = useState(0);
      return (
        <div>
          <div>Hello World</div>
          <button onClick={() => setCount((c) => c + 1)}>Count: {count}</button>
        </div>
      );
    }
    render(
        <QueryClientProvider client={queryClient}>
                <SimpleComponent />
        </QueryClientProvider>
    );
    expect(screen.getByText("Hello World")).toBeInTheDocument();
    expect(screen.getByText("Count: 0")).toBeInTheDocument();
  });
});