Skip to content

Commit

Permalink
Tests: Add index endpoint blacklist test (anuraghazra#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 committed Dec 22, 2023
1 parent f3e10ec commit 4f79476
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
});
});

0 comments on commit 4f79476

Please sign in to comment.