import App from "./app.jsx";
import axios from "axios";
jest.mock("axios");
beforeEach(() => {
axios.create = jest.fn(() => axios);
axios.get.mockImplementation((url) => {
return Promise.resolve({
data: [{ id: 1, name: "books" }],
});
});
});
test("should display app", async () => {
render(<App />);
expect(await screen.findByText("books")).toBeInTheDocument();
});