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-05-26 22:02:37 -04:00
|
|
|
|
2024-06-02 01:21:21 -04:00
|
|
|
test("queryOMDb returns movie with error", async () => {
|
|
|
|
const data = await queryOMDb("f=dune");
|
2024-05-26 22:02:37 -04:00
|
|
|
|
2024-06-02 01:21:21 -04:00
|
|
|
expect(data).toHaveProperty("Response", "False");
|
|
|
|
});
|
|
|
|
});
|