mirror of
https://github.com/anuraghazra/github-readme-stats.git
synced 2024-11-27 05:30:32 +08:00
refactor: improve blacklisted username error by adding secondary message (#3444)
This commit is contained in:
parent
9c6eb22862
commit
89fc14609e
@ -43,7 +43,7 @@ export default async (req, res) => {
|
||||
|
||||
if (blacklist.includes(username)) {
|
||||
return res.send(
|
||||
renderError("Something went wrong", "", {
|
||||
renderError("Something went wrong", "This username is blacklisted", {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
|
@ -30,7 +30,7 @@ export default async (req, res) => {
|
||||
|
||||
if (blacklist.includes(username)) {
|
||||
return res.send(
|
||||
renderError("Something went wrong", "", {
|
||||
renderError("Something went wrong", "This username is blacklisted", {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
|
@ -38,7 +38,7 @@ export default async (req, res) => {
|
||||
|
||||
if (blacklist.includes(username)) {
|
||||
return res.send(
|
||||
renderError("Something went wrong", "", {
|
||||
renderError("Something went wrong", "This username is blacklisted", {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
|
@ -291,7 +291,9 @@ describe("Test /api/", () => {
|
||||
await api(req, res);
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
);
|
||||
});
|
||||
|
||||
it("should render error card when wrong locale is provided", async () => {
|
||||
|
@ -155,7 +155,9 @@ describe("Test /api/pin", () => {
|
||||
await pin(req, res);
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
);
|
||||
});
|
||||
|
||||
it("should render error card if wrong locale provided", async () => {
|
||||
|
@ -183,7 +183,9 @@ describe("Test /api/top-langs", () => {
|
||||
await topLangs(req, res);
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
);
|
||||
});
|
||||
|
||||
it("should render error card if wrong locale provided", async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user