From 988044a199a4fbe5856a42d0522c4ac2871b162b Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov Date: Wed, 23 Aug 2023 10:58:21 +0300 Subject: [PATCH] Tests: Add index endpoint blacklist test (#3130) --- tests/api.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/api.test.js b/tests/api.test.js index 567d2c1..936938f 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -276,4 +276,13 @@ describe("Test /api/", () => { }), ); }); + + it("should render error card if username in blacklist", async () => { + const { req, res } = faker({ username: "renovate-bot" }, data_stats); + + await api(req, res); + + expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml"); + expect(res.send).toBeCalledWith(renderError("Something went wrong")); + }); });