Movie_Search/movie-search/__tests__/omdb.test.jsx

16 lines
467 B
React
Raw Permalink Normal View History

2024-05-25 01:03:21 -04:00
import "@testing-library/jest-dom";
import { queryOMDb } from "../src/api/omdb.ts";
2024-06-02 01:21:21 -04:00
describe("OMDb API Integration", () => {
test("queryOMDb returns movie data successfully", async () => {
const data = await queryOMDb("s=back to");
2024-05-25 01:03:21 -04:00
2024-06-02 01:21:21 -04:00
expect(data).toHaveProperty("Response", "True");
});
2024-06-02 01:21:21 -04:00
test("queryOMDb returns movie with error", async () => {
const data = await queryOMDb("f=dune");
2024-06-02 01:21:21 -04:00
expect(data).toHaveProperty("Response", "False");
});
});