Skip to content

Commit

Permalink
tests(stats card): cover with test changes in anuraghazra#3298 (anura…
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 committed Dec 22, 2023
1 parent 91a4de0 commit c7a62da
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit c7a62da

Please sign in to comment.