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