mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-09-03 00:17:58 +00:00
refactor: improve blacklisted username error by adding secondary message (#3444)
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
+3
-1
@@ -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 () => {
|
||||
|
||||
+3
-1
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user