Skip to content

Commit

Permalink
Tests: Add index endpoint wrong locale test (anuraghazra#3131)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 authored and devantler committed Sep 24, 2023
1 parent 41d2d27 commit 6272867
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,15 @@ describe("Test /api/", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
});

it("should render error card when wrong locale is provided", async () => {
const { req, res } = faker({ locale: "asdf" }, data_stats);

await api(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "Language not found"),
);
});
});

0 comments on commit 6272867

Please sign in to comment.