From 5b72dfbc32b0958bf4225400c1489f7703402faf Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov Date: Mon, 30 Oct 2023 12:34:42 +0200 Subject: [PATCH] tests(stats card): cover with test changes in #3298 (#3443) --- tests/api.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/api.test.js b/tests/api.test.js index 0c0da38..eee9a1a 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -120,6 +120,21 @@ describe("Test /api/", () => { ); }); + it("should render error card in same theme as requested card", async () => { + const { req, res } = faker({ theme: "merko" }, error); + + await api(req, res); + + expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml"); + expect(res.send).toBeCalledWith( + renderError( + error.errors[0].message, + "Make sure the provided username is not an organization", + { theme: "merko" }, + ), + ); + }); + it("should get the query options", async () => { const { req, res } = faker( {