Tests: Add index endpoint wrong locale test (#3131)

This commit is contained in:
Alexandr Garbuzov 2023-08-23 15:26:04 +03:00 committed by GitHub
parent 25531b2f52
commit a5ddf2632b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"),
);
});
});