tests(stats card): cover with test changes in #3298 (#3443)

This commit is contained in:
Alexandr Garbuzov 2023-10-30 12:34:42 +02:00 committed by GitHub
parent 89fc14609e
commit 5b72dfbc32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(
{