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

19 lines
584 B
React
Raw Normal View History

2024-05-25 01:03:21 -04:00
import "@testing-library/jest-dom";
import { queryOMDb } from "../src/api/omdb.ts";
test("queryOMDb returns movie data successfully", async () => {
2024-05-25 01:03:21 -04:00
const data = await queryOMDb("s=back to");
expect(data).toHaveProperty("Response", "True");
});
2024-05-25 01:03:21 -04:00
test("queryOMDb returns movie with error", async () => {
const data = await queryOMDb("f=dune");
expect(data).toHaveProperty("Response", "False");
2024-05-25 01:03:21 -04:00
});
// f=dune
// Warning: React does not recognize the `fetchPriority` prop on a DOM element
// The `punycode` module is deprecated. Please use a userland alternative instead.