feat: added repo card hide border option (#488)

* 🚀 Prettier config

* 🚀 hide_border for Repo Card

* fix: wrong total commits (#490)

* chore: run prettier on all files

* chore: lol lets add the trailing commas

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>
This commit is contained in:
Bas950andAnurag Hazra authored and GitHub committed 2020-09-24 21:38:14 +05:30
1 parent 3c6c142c75
commit 8aea1e3c35
35 files changed
+144 -126

No files matched your search

+4 -1
View File
@@ -9,4 +9,7 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username otechie: # Replace with a single Otechie username
custom: ["https://www.paypal.me/anuraghazra", "https://www.buymeacoffee.com/anuraghazra"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] custom: [
"https://www.paypal.me/anuraghazra",
"https://www.buymeacoffee.com/anuraghazra",
] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+2 -1
View File
@@ -26,7 +26,8 @@ jobs:
cache-name: cache-node-modules cache-name: cache-node-modules
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }} key:
${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-npm-cache- ${{ runner.os }}-npm-cache-
+5
View File
@@ -0,0 +1,5 @@
node_modules
*.json
*.md
coverage
.vercel
+6
View File
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"useTabs": false,
"endOfLine": "auto",
"proseWrap": "always"
}
+3 -3
View File
@@ -40,13 +40,13 @@ module.exports = async (req, res) => {
stats = await fetchStats( stats = await fetchStats(
username, username,
parseBoolean(count_private), parseBoolean(count_private),
parseBoolean(include_all_commits) parseBoolean(include_all_commits),
); );
const cacheSeconds = clampValue( const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10), parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS, CONSTANTS.TWO_HOURS,
CONSTANTS.ONE_DAY CONSTANTS.ONE_DAY,
); );
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`); res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
@@ -65,7 +65,7 @@ module.exports = async (req, res) => {
text_color, text_color,
bg_color, bg_color,
theme, theme,
}) }),
); );
} catch (err) { } catch (err) {
return res.send(renderError(err.message, err.secondaryMessage)); return res.send(renderError(err.message, err.secondaryMessage));
+4 -2
View File
@@ -13,6 +13,7 @@ module.exports = async (req, res) => {
const { const {
username, username,
repo, repo,
hide_border,
title_color, title_color,
icon_color, icon_color,
text_color, text_color,
@@ -36,7 +37,7 @@ module.exports = async (req, res) => {
let cacheSeconds = clampValue( let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10), parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS, CONSTANTS.TWO_HOURS,
CONSTANTS.ONE_DAY CONSTANTS.ONE_DAY,
); );
/* /*
@@ -56,13 +57,14 @@ module.exports = async (req, res) => {
return res.send( return res.send(
renderRepoCard(repoData, { renderRepoCard(repoData, {
hide_border,
title_color, title_color,
icon_color, icon_color,
text_color, text_color,
bg_color, bg_color,
theme, theme,
show_owner: parseBoolean(show_owner), show_owner: parseBoolean(show_owner),
}) }),
); );
} catch (err) { } catch (err) {
return res.send(renderError(err.message, err.secondaryMessage)); return res.send(renderError(err.message, err.secondaryMessage));
+2 -2
View File
@@ -39,7 +39,7 @@ module.exports = async (req, res) => {
const cacheSeconds = clampValue( const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10), parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS, CONSTANTS.TWO_HOURS,
CONSTANTS.ONE_DAY CONSTANTS.ONE_DAY,
); );
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`); res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
@@ -55,7 +55,7 @@ module.exports = async (req, res) => {
bg_color, bg_color,
theme, theme,
layout, layout,
}) }),
); );
} catch (err) { } catch (err) {
return res.send(renderError(err.message, err.secondaryMessage)); return res.send(renderError(err.message, err.secondaryMessage));
+2 -2
View File
@@ -31,7 +31,7 @@ module.exports = async (req, res) => {
let cacheSeconds = clampValue( let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10), parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS, CONSTANTS.TWO_HOURS,
CONSTANTS.ONE_DAY CONSTANTS.ONE_DAY,
); );
if (!cache_seconds) { if (!cache_seconds) {
@@ -51,7 +51,7 @@ module.exports = async (req, res) => {
bg_color, bg_color,
theme, theme,
hide_progress, hide_progress,
}) }),
); );
} catch (err) { } catch (err) {
return res.send(renderError(err.message, err.secondaryMessage)); return res.send(renderError(err.message, err.secondaryMessage));
+1 -1
View File
@@ -133,6 +133,7 @@ You can customize the appearance of your `Stats Card` or `Repo Card` however you
- `text_color` - Body text color _(hex color)_ - `text_color` - Body text color _(hex color)_
- `icon_color` - Icons color if available _(hex color)_ - `icon_color` - Icons color if available _(hex color)_
- `bg_color` - Card's background color _(hex color)_ **or** a gradient in the form of _angle,start,end_ - `bg_color` - Card's background color _(hex color)_ **or** a gradient in the form of _angle,start,end_
- `hide_border` - Hides the card's border _(boolean)_
- `theme` - name of the theme, choose from [all available themes](./themes/README.md) - `theme` - name of the theme, choose from [all available themes](./themes/README.md)
- `cache_seconds` - set the cache header manually _(min: 1800, max: 86400)_ - `cache_seconds` - set the cache header manually _(min: 1800, max: 86400)_
@@ -175,7 +176,6 @@ You can provide multiple comma-separated values in bg_color option to render a g
#### Wakatime Card Exclusive Options: #### Wakatime Card Exclusive Options:
- `hide_title` - _(boolean)_ - `hide_title` - _(boolean)_
- `hide_border` - _(boolean)_
- `line_height` - Sets the line-height between text _(number)_ - `line_height` - Sets the line-height between text _(number)_
- `hide_progress` - Hides the progress bar and percentage _(boolean)_ - `hide_progress` - Hides the progress bar and percentage _(boolean)_
+1 -1
View File
@@ -66,7 +66,7 @@ const createTableItem = ({ link, label, isRepoCard }) => {
const generateTable = ({ isRepoCard }) => { const generateTable = ({ isRepoCard }) => {
const rows = []; const rows = [];
const themes = Object.keys(theme).filter( const themes = Object.keys(theme).filter(
(name) => name !== (!isRepoCard ? "default_repocard" : "default") (name) => name !== (!isRepoCard ? "default_repocard" : "default"),
); );
for (let i = 0; i < themes.length; i += 3) { for (let i = 0; i < themes.length; i += 3) {
+1 -1
View File
@@ -55,7 +55,7 @@ async function run() {
return; return;
} }
colors = colors.map((color) => colors = colors.map((color) =>
color.replace(/.*\:\s/, "").replace(/\"/g, "") color.replace(/.*\:\s/, "").replace(/\"/g, ""),
); );
let titleColor = colors[0]; let titleColor = colors[0];
+2 -1
View File
@@ -21,6 +21,7 @@ const renderRepoCard = (repo, options = {}) => {
forkCount, forkCount,
} = repo; } = repo;
const { const {
hide_border = false,
title_color, title_color,
icon_color, icon_color,
text_color, text_color,
@@ -118,7 +119,7 @@ const renderRepoCard = (repo, options = {}) => {
}); });
card.disableAnimations(); card.disableAnimations();
card.setHideBorder(false); card.setHideBorder(hide_border);
card.setHideTitle(false); card.setHideTitle(false);
card.setCSS(` card.setCSS(`
.description { font: 400 13px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} } .description { font: 400 13px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
+2 -2
View File
@@ -124,14 +124,14 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
index, index,
showIcons: show_icons, showIcons: show_icons,
shiftValuePos: !include_all_commits, shiftValuePos: !include_all_commits,
}) }),
); );
// Calculate the card height depending on how many items there are // Calculate the card height depending on how many items there are
// but if rank circle is visible clamp the minimum height to `150` // but if rank circle is visible clamp the minimum height to `150`
let height = Math.max( let height = Math.max(
45 + (statItems.length + 1) * lheight, 45 + (statItems.length + 1) * lheight,
hide_rank ? 0 : 150 hide_rank ? 0 : 150,
); );
// Conditionally rendered elements // Conditionally rendered elements
+1 -1
View File
@@ -116,7 +116,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
` `
${cssStyles} ${cssStyles}
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} } .lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
` `,
); );
return card.render(` return card.render(`
+1 -1
View File
@@ -9,7 +9,7 @@ const retryer = async (fetcher, variables, retries = 0) => {
let response = await fetcher( let response = await fetcher(
variables, variables,
process.env[`PAT_${retries + 1}`], process.env[`PAT_${retries + 1}`],
retries retries,
); );
// prettier-ignore // prettier-ignore
+5 -5
View File
@@ -37,7 +37,7 @@ function kFormatter(num) {
function isValidHexColor(hexColor) { function isValidHexColor(hexColor) {
return new RegExp( return new RegExp(
/^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{4})$/ /^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{4})$/,
).test(hexColor); ).test(hexColor);
} }
@@ -124,19 +124,19 @@ function getCardColors({
// finally if both colors are invalid fallback to default theme // finally if both colors are invalid fallback to default theme
const titleColor = fallbackColor( const titleColor = fallbackColor(
title_color || selectedTheme.title_color, title_color || selectedTheme.title_color,
"#" + defaultTheme.title_color "#" + defaultTheme.title_color,
); );
const iconColor = fallbackColor( const iconColor = fallbackColor(
icon_color || selectedTheme.icon_color, icon_color || selectedTheme.icon_color,
"#" + defaultTheme.icon_color "#" + defaultTheme.icon_color,
); );
const textColor = fallbackColor( const textColor = fallbackColor(
text_color || selectedTheme.text_color, text_color || selectedTheme.text_color,
"#" + defaultTheme.text_color "#" + defaultTheme.text_color,
); );
const bgColor = fallbackColor( const bgColor = fallbackColor(
bg_color || selectedTheme.bg_color, bg_color || selectedTheme.bg_color,
"#" + defaultTheme.bg_color "#" + defaultTheme.bg_color,
); );
return { titleColor, iconColor, textColor, bgColor }; return { titleColor, iconColor, textColor, bgColor };
+1 -1
View File
@@ -39,7 +39,7 @@ const fetcher = (variables, token) => {
}, },
{ {
Authorization: `bearer ${token}`, Authorization: `bearer ${token}`,
} },
); );
}; };
+3 -3
View File
@@ -45,7 +45,7 @@ const fetcher = (variables, token) => {
}, },
{ {
Authorization: `bearer ${token}`, Authorization: `bearer ${token}`,
} },
); );
}; };
@@ -86,7 +86,7 @@ const totalCommitsFetcher = async (username) => {
async function fetchStats( async function fetchStats(
username, username,
count_private = false, count_private = false,
include_all_commits = false include_all_commits = false,
) { ) {
if (!username) throw Error("Invalid username"); if (!username) throw Error("Invalid username");
@@ -106,7 +106,7 @@ async function fetchStats(
logger.error(res.data.errors); logger.error(res.data.errors);
throw new CustomError( throw new CustomError(
res.data.errors[0].message || "Could not fetch user", res.data.errors[0].message || "Could not fetch user",
CustomError.USER_NOT_FOUND CustomError.USER_NOT_FOUND,
); );
} }
+1 -1
View File
@@ -29,7 +29,7 @@ const fetcher = (variables, token) => {
}, },
{ {
Authorization: `bearer ${token}`, Authorization: `bearer ${token}`,
} },
); );
}; };
+1 -1
View File
@@ -2,7 +2,7 @@ const axios = require("axios");
const fetchLast7Days = async ({ username }) => { const fetchLast7Days = async ({ username }) => {
const { data } = await axios.get( const { data } = await axios.get(
`https://wakatime.com/api/v1/users/${username}/stats/last_7_days?is_including_today=true` `https://wakatime.com/api/v1/users/${username}/stats/last_7_days?is_including_today=true`,
); );
return data.data; return data.data;
+7 -7
View File
@@ -97,8 +97,8 @@ describe("Test /api/", () => {
expect(res.send).toBeCalledWith( expect(res.send).toBeCalledWith(
renderError( renderError(
error.errors[0].message, error.errors[0].message,
"Make sure the provided username is not an organization" "Make sure the provided username is not an organization",
) ),
); );
}); });
@@ -115,7 +115,7 @@ describe("Test /api/", () => {
text_color: "fff", text_color: "fff",
bg_color: "fff", bg_color: "fff",
}, },
data data,
); );
await api(req, res); await api(req, res);
@@ -131,7 +131,7 @@ describe("Test /api/", () => {
icon_color: "fff", icon_color: "fff",
text_color: "fff", text_color: "fff",
bg_color: "fff", bg_color: "fff",
}) }),
); );
}); });
@@ -196,7 +196,7 @@ describe("Test /api/", () => {
username: "anuraghazra", username: "anuraghazra",
count_private: true, count_private: true,
}, },
data data,
); );
await api(req, res); await api(req, res);
@@ -217,8 +217,8 @@ describe("Test /api/", () => {
issues: stats.totalIssues, issues: stats.totalIssues,
}), }),
}, },
{} {},
) ),
); );
}); });
}); });
+1 -1
View File
@@ -12,7 +12,7 @@ describe("Test calculateRank", () => {
stargazers: 400, stargazers: 400,
prs: 300, prs: 300,
issues: 200, issues: 200,
}) }),
).toStrictEqual({ level: "A+", score: 49.16605417270399 }); ).toStrictEqual({ level: "A+", score: 49.16605417270399 });
}); });
}); });
+13 -13
View File
@@ -13,7 +13,7 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"stroke-opacity", "stroke-opacity",
"0" "0",
); );
}); });
@@ -24,7 +24,7 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"stroke-opacity", "stroke-opacity",
"1" "1",
); );
}); });
@@ -63,11 +63,11 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(document.getElementsByTagName("svg")[0]).toHaveAttribute( expect(document.getElementsByTagName("svg")[0]).toHaveAttribute(
"height", "height",
"200" "200",
); );
expect(document.getElementsByTagName("svg")[0]).toHaveAttribute( expect(document.getElementsByTagName("svg")[0]).toHaveAttribute(
"height", "height",
"200" "200",
); );
}); });
@@ -78,7 +78,7 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(document.getElementsByTagName("svg")[0]).toHaveAttribute( expect(document.getElementsByTagName("svg")[0]).toHaveAttribute(
"height", "height",
"170" "170",
); );
}); });
@@ -87,7 +87,7 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(queryByTestId(document.body, "main-card-body")).toHaveAttribute( expect(queryByTestId(document.body, "main-card-body")).toHaveAttribute(
"transform", "transform",
"translate(0, 55)" "translate(0, 55)",
); );
}); });
@@ -98,7 +98,7 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(queryByTestId(document.body, "main-card-body")).toHaveAttribute( expect(queryByTestId(document.body, "main-card-body")).toHaveAttribute(
"transform", "transform",
"translate(0, 25)" "translate(0, 25)",
); );
}); });
@@ -130,7 +130,7 @@ describe("Card", () => {
expect(headerClassStyles.fill).toBe("#f00"); expect(headerClassStyles.fill).toBe("#f00");
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#fff" "#fff",
); );
}); });
it("should render gradient backgrounds", () => { it("should render gradient backgrounds", () => {
@@ -154,20 +154,20 @@ describe("Card", () => {
document.body.innerHTML = card.render(``); document.body.innerHTML = card.render(``);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"url(#gradient)" "url(#gradient)",
); );
expect(document.querySelector("defs linearGradient")).toHaveAttribute( expect(document.querySelector("defs linearGradient")).toHaveAttribute(
"gradientTransform", "gradientTransform",
"rotate(90)" "rotate(90)",
); );
expect( expect(
document.querySelector("defs linearGradient stop:nth-child(1)") document.querySelector("defs linearGradient stop:nth-child(1)"),
).toHaveAttribute("stop-color", "#fff"); ).toHaveAttribute("stop-color", "#fff");
expect( expect(
document.querySelector("defs linearGradient stop:nth-child(2)") document.querySelector("defs linearGradient stop:nth-child(2)"),
).toHaveAttribute("stop-color", "#000"); ).toHaveAttribute("stop-color", "#000");
expect( expect(
document.querySelector("defs linearGradient stop:nth-child(3)") document.querySelector("defs linearGradient stop:nth-child(3)"),
).toHaveAttribute("stop-color", "#f00"); ).toHaveAttribute("stop-color", "#f00");
}); });
}); });
+4 -4
View File
@@ -57,7 +57,7 @@ describe("Test fetchRepo", () => {
.reply(200, { data: { user: { repository: null }, organization: null } }); .reply(200, { data: { user: { repository: null }, organization: null } });
await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow( await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow(
"User Repository Not found" "User Repository Not found",
); );
}); });
@@ -67,7 +67,7 @@ describe("Test fetchRepo", () => {
.reply(200, { data: { user: null, organization: { repository: null } } }); .reply(200, { data: { user: null, organization: { repository: null } } });
await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow( await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow(
"Organization Repository Not found" "Organization Repository Not found",
); );
}); });
@@ -77,7 +77,7 @@ describe("Test fetchRepo", () => {
.reply(200, { data: { user: null, organization: null } }); .reply(200, { data: { user: null, organization: null } });
await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow( await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow(
"Not found" "Not found",
); );
}); });
@@ -90,7 +90,7 @@ describe("Test fetchRepo", () => {
}); });
await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow( await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow(
"User Repository Not found" "User Repository Not found",
); );
}); });
}); });
+1 -1
View File
@@ -77,7 +77,7 @@ describe("Test fetchStats", () => {
mock.onPost("https://api.github.com/graphql").reply(200, error); mock.onPost("https://api.github.com/graphql").reply(200, error);
await expect(fetchStats("anuraghazra")).rejects.toThrow( await expect(fetchStats("anuraghazra")).rejects.toThrow(
"Could not resolve to a User with the login of 'noname'." "Could not resolve to a User with the login of 'noname'.",
); );
}); });
+1 -1
View File
@@ -91,7 +91,7 @@ describe("FetchTopLanguages", () => {
mock.onPost("https://api.github.com/graphql").reply(200, error); mock.onPost("https://api.github.com/graphql").reply(200, error);
await expect(fetchTopLanguages("anuraghazra")).rejects.toThrow( await expect(fetchTopLanguages("anuraghazra")).rejects.toThrow(
"Could not resolve to a User with the login of 'noname'." "Could not resolve to a User with the login of 'noname'.",
); );
}); });
}); });
+2 -2
View File
@@ -105,7 +105,7 @@ describe("Wakatime fetcher", () => {
const username = "anuraghazra"; const username = "anuraghazra";
mock mock
.onGet( .onGet(
`https://wakatime.com/api/v1/users/${username}/stats/last_7_days?is_including_today=true` `https://wakatime.com/api/v1/users/${username}/stats/last_7_days?is_including_today=true`,
) )
.reply(200, wakaTimeData); .reply(200, wakaTimeData);
@@ -207,7 +207,7 @@ describe("Wakatime fetcher", () => {
mock.onGet(/\/https:\/\/wakatime\.com\/api/).reply(404, wakaTimeData); mock.onGet(/\/https:\/\/wakatime\.com\/api/).reply(404, wakaTimeData);
await expect(fetchLast7Days("noone")).rejects.toThrow( await expect(fetchLast7Days("noone")).rejects.toThrow(
"Request failed with status code 404" "Request failed with status code 404",
); );
}); });
}); });
+2 -2
View File
@@ -76,7 +76,7 @@ describe("Test /api/pin", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml"); expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith( expect(res.send).toBeCalledWith(
renderRepoCard(data_repo.repository, { ...req.query }) renderRepoCard(data_repo.repository, { ...req.query }),
); );
}); });
@@ -120,7 +120,7 @@ describe("Test /api/pin", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml"); expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith( expect(res.send).toBeCalledWith(
renderError("Organization Repository Not found") renderError("Organization Repository Not found"),
); );
}); });
}); });
+17 -17
View File
@@ -29,16 +29,16 @@ describe("Test renderRepoCard", () => {
expect(header).toHaveTextContent("convoychat"); expect(header).toHaveTextContent("convoychat");
expect(header).not.toHaveTextContent("anuraghazra"); expect(header).not.toHaveTextContent("anuraghazra");
expect(document.getElementsByClassName("description")[0]).toHaveTextContent( expect(document.getElementsByClassName("description")[0]).toHaveTextContent(
"Help us take over the world! React + TS + GraphQL Chat App" "Help us take over the world! React + TS + GraphQL Chat App",
); );
expect(queryByTestId(document.body, "stargazers")).toHaveTextContent("38k"); expect(queryByTestId(document.body, "stargazers")).toHaveTextContent("38k");
expect(queryByTestId(document.body, "forkcount")).toHaveTextContent("100"); expect(queryByTestId(document.body, "forkcount")).toHaveTextContent("100");
expect(queryByTestId(document.body, "lang-name")).toHaveTextContent( expect(queryByTestId(document.body, "lang-name")).toHaveTextContent(
"TypeScript" "TypeScript",
); );
expect(queryByTestId(document.body, "lang-color")).toHaveAttribute( expect(queryByTestId(document.body, "lang-color")).toHaveAttribute(
"fill", "fill",
"#2b7489" "#2b7489",
); );
}); });
@@ -47,7 +47,7 @@ describe("Test renderRepoCard", () => {
show_owner: true, show_owner: true,
}); });
expect(document.getElementsByClassName("header")[0]).toHaveTextContent( expect(document.getElementsByClassName("header")[0]).toHaveTextContent(
"anuraghazra/convoychat" "anuraghazra/convoychat",
); );
}); });
@@ -59,11 +59,11 @@ describe("Test renderRepoCard", () => {
}); });
expect( expect(
document.getElementsByClassName("description")[0].children[0].textContent document.getElementsByClassName("description")[0].children[0].textContent,
).toBe("The quick brown fox jumps over the lazy dog is an"); ).toBe("The quick brown fox jumps over the lazy dog is an");
expect( expect(
document.getElementsByClassName("description")[0].children[1].textContent document.getElementsByClassName("description")[0].children[1].textContent,
).toBe("English-language pangram—a sentence that contains all"); ).toBe("English-language pangram—a sentence that contains all");
// Should not trim // Should not trim
@@ -73,7 +73,7 @@ describe("Test renderRepoCard", () => {
}); });
expect(document.getElementsByClassName("description")[0]).toHaveTextContent( expect(document.getElementsByClassName("description")[0]).toHaveTextContent(
"Small text should not trim" "Small text should not trim",
); );
}); });
@@ -85,7 +85,7 @@ describe("Test renderRepoCard", () => {
// poop emoji may not show in all editors but it's there between "a" and "poo" // poop emoji may not show in all editors but it's there between "a" and "poo"
expect(document.getElementsByClassName("description")[0]).toHaveTextContent( expect(document.getElementsByClassName("description")[0]).toHaveTextContent(
"This is a text with a 💩 poo emoji" "This is a text with a 💩 poo emoji",
); );
}); });
@@ -101,7 +101,7 @@ describe("Test renderRepoCard", () => {
expect(queryByTestId(document.body, "primary-lang")).toBeInTheDocument(); expect(queryByTestId(document.body, "primary-lang")).toBeInTheDocument();
expect(queryByTestId(document.body, "star-fork-group")).toHaveAttribute( expect(queryByTestId(document.body, "star-fork-group")).toHaveAttribute(
"transform", "transform",
"translate(155, 0)" "translate(155, 0)",
); );
// Small lang // Small lang
@@ -115,7 +115,7 @@ describe("Test renderRepoCard", () => {
expect(queryByTestId(document.body, "star-fork-group")).toHaveAttribute( expect(queryByTestId(document.body, "star-fork-group")).toHaveAttribute(
"transform", "transform",
"translate(125, 0)" "translate(125, 0)",
); );
}); });
@@ -135,11 +135,11 @@ describe("Test renderRepoCard", () => {
expect(queryByTestId(document.body, "primary-lang")).toBeInTheDocument(); expect(queryByTestId(document.body, "primary-lang")).toBeInTheDocument();
expect(queryByTestId(document.body, "lang-color")).toHaveAttribute( expect(queryByTestId(document.body, "lang-color")).toHaveAttribute(
"fill", "fill",
"#333" "#333",
); );
expect(queryByTestId(document.body, "lang-name")).toHaveTextContent( expect(queryByTestId(document.body, "lang-name")).toHaveTextContent(
"Unspecified" "Unspecified",
); );
}); });
@@ -158,7 +158,7 @@ describe("Test renderRepoCard", () => {
expect(iconClassStyles.fill).toBe("#586069"); expect(iconClassStyles.fill).toBe("#586069");
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#fffefe" "#fffefe",
); );
}); });
@@ -186,7 +186,7 @@ describe("Test renderRepoCard", () => {
expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`); expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#252525" "#252525",
); );
}); });
@@ -208,7 +208,7 @@ describe("Test renderRepoCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes[name].bg_color}` `#${themes[name].bg_color}`,
); );
}); });
}); });
@@ -231,7 +231,7 @@ describe("Test renderRepoCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes.radical.bg_color}` `#${themes.radical.bg_color}`,
); );
}); });
@@ -254,7 +254,7 @@ describe("Test renderRepoCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes.radical.bg_color}` `#${themes.radical.bg_color}`,
); );
}); });
+12 -12
View File
@@ -24,11 +24,11 @@ describe("Test renderStatsCard", () => {
document.body.innerHTML = renderStatsCard(stats); document.body.innerHTML = renderStatsCard(stats);
expect(document.getElementsByClassName("header")[0].textContent).toBe( expect(document.getElementsByClassName("header")[0].textContent).toBe(
"Anurag Hazra's GitHub Stats" "Anurag Hazra's GitHub Stats",
); );
expect( expect(
document.body.getElementsByTagName("svg")[0].getAttribute("height") document.body.getElementsByTagName("svg")[0].getAttribute("height"),
).toBe("195"); ).toBe("195");
expect(getByTestId(document.body, "stars").textContent).toBe("100"); expect(getByTestId(document.body, "stars").textContent).toBe("100");
expect(getByTestId(document.body, "commits").textContent).toBe("200"); expect(getByTestId(document.body, "commits").textContent).toBe("200");
@@ -43,13 +43,13 @@ describe("Test renderStatsCard", () => {
document.body.innerHTML = renderStatsCard({ ...stats, name: "Anil Das" }); document.body.innerHTML = renderStatsCard({ ...stats, name: "Anil Das" });
expect(document.getElementsByClassName("header")[0].textContent).toBe( expect(document.getElementsByClassName("header")[0].textContent).toBe(
"Anil Das' GitHub Stats" "Anil Das' GitHub Stats",
); );
document.body.innerHTML = renderStatsCard({ ...stats, name: "Felix" }); document.body.innerHTML = renderStatsCard({ ...stats, name: "Felix" });
expect(document.getElementsByClassName("header")[0].textContent).toBe( expect(document.getElementsByClassName("header")[0].textContent).toBe(
"Felix' GitHub Stats" "Felix' GitHub Stats",
); );
}); });
@@ -59,7 +59,7 @@ describe("Test renderStatsCard", () => {
}); });
expect( expect(
document.body.getElementsByTagName("svg")[0].getAttribute("height") document.body.getElementsByTagName("svg")[0].getAttribute("height"),
).toBe("150"); // height should be 150 because we clamped it. ).toBe("150"); // height should be 150 because we clamped it.
expect(queryByTestId(document.body, "stars")).toBeDefined(); expect(queryByTestId(document.body, "stars")).toBeDefined();
@@ -90,7 +90,7 @@ describe("Test renderStatsCard", () => {
expect(iconClassStyles.fill).toBe("#4c71f2"); expect(iconClassStyles.fill).toBe("#4c71f2");
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#fffefe" "#fffefe",
); );
}); });
@@ -116,7 +116,7 @@ describe("Test renderStatsCard", () => {
expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`); expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#252525" "#252525",
); );
}); });
@@ -138,7 +138,7 @@ describe("Test renderStatsCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes.radical.bg_color}` `#${themes.radical.bg_color}`,
); );
}); });
@@ -160,7 +160,7 @@ describe("Test renderStatsCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes[name].bg_color}` `#${themes[name].bg_color}`,
); );
}); });
}); });
@@ -184,7 +184,7 @@ describe("Test renderStatsCard", () => {
expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes.radical.bg_color}` `#${themes.radical.bg_color}`,
); );
}); });
@@ -196,7 +196,7 @@ describe("Test renderStatsCard", () => {
expect(queryAllByTestId(document.body, "icon")[0]).toBeDefined(); expect(queryAllByTestId(document.body, "icon")[0]).toBeDefined();
expect(queryByTestId(document.body, "stars")).toBeDefined(); expect(queryByTestId(document.body, "stars")).toBeDefined();
expect( expect(
queryByTestId(document.body, "stars").previousElementSibling // the label queryByTestId(document.body, "stars").previousElementSibling, // the label
).toHaveAttribute("x", "25"); ).toHaveAttribute("x", "25");
}); });
@@ -206,7 +206,7 @@ describe("Test renderStatsCard", () => {
expect(queryAllByTestId(document.body, "icon")[0]).not.toBeDefined(); expect(queryAllByTestId(document.body, "icon")[0]).not.toBeDefined();
expect(queryByTestId(document.body, "stars")).toBeDefined(); expect(queryByTestId(document.body, "stars")).toBeDefined();
expect( expect(
queryByTestId(document.body, "stars").previousElementSibling // the label queryByTestId(document.body, "stars").previousElementSibling, // the label
).not.toHaveAttribute("x"); ).not.toHaveAttribute("x");
}); });
}); });
+22 -22
View File
@@ -28,29 +28,29 @@ describe("Test renderTopLanguages", () => {
document.body.innerHTML = renderTopLanguages(langs); document.body.innerHTML = renderTopLanguages(langs);
expect(queryByTestId(document.body, "header")).toHaveTextContent( expect(queryByTestId(document.body, "header")).toHaveTextContent(
"Most Used Languages" "Most Used Languages",
); );
expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent(
"HTML" "HTML",
); );
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
"javascript" "javascript",
); );
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
"css" "css",
); );
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
"width", "width",
"40%" "40%",
); );
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
"width", "width",
"40%" "40%",
); );
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
"width", "width",
"20%" "20%",
); );
}); });
@@ -59,10 +59,10 @@ describe("Test renderTopLanguages", () => {
hide: ["HTML"], hide: ["HTML"],
}); });
expect(queryAllByTestId(document.body, "lang-name")[0]).toBeInTheDocument( expect(queryAllByTestId(document.body, "lang-name")[0]).toBeInTheDocument(
"javascript" "javascript",
); );
expect(queryAllByTestId(document.body, "lang-name")[1]).toBeInTheDocument( expect(queryAllByTestId(document.body, "lang-name")[1]).toBeInTheDocument(
"css" "css",
); );
expect(queryAllByTestId(document.body, "lang-name")[2]).not.toBeDefined(); expect(queryAllByTestId(document.body, "lang-name")[2]).not.toBeDefined();
@@ -71,7 +71,7 @@ describe("Test renderTopLanguages", () => {
hide: ["HTML", "css"], hide: ["HTML", "css"],
}); });
expect(queryAllByTestId(document.body, "lang-name")[0]).toBeInTheDocument( expect(queryAllByTestId(document.body, "lang-name")[0]).toBeInTheDocument(
"javascript" "javascript",
); );
expect(queryAllByTestId(document.body, "lang-name")[1]).not.toBeDefined(); expect(queryAllByTestId(document.body, "lang-name")[1]).not.toBeDefined();
}); });
@@ -89,7 +89,7 @@ describe("Test renderTopLanguages", () => {
size: 100, size: 100,
}, },
}, },
{} {},
); );
expect(document.querySelector("svg")).toHaveAttribute("height", "245"); expect(document.querySelector("svg")).toHaveAttribute("height", "245");
}); });
@@ -116,7 +116,7 @@ describe("Test renderTopLanguages", () => {
expect(langNameStyles.fill).toBe("#333"); expect(langNameStyles.fill).toBe("#333");
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#fffefe" "#fffefe",
); );
}); });
@@ -140,7 +140,7 @@ describe("Test renderTopLanguages", () => {
expect(langNameStyles.fill).toBe(`#${customColors.text_color}`); expect(langNameStyles.fill).toBe(`#${customColors.text_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
"#252525" "#252525",
); );
}); });
@@ -160,7 +160,7 @@ describe("Test renderTopLanguages", () => {
expect(langNameStyles.fill).toBe(`#${themes.radical.text_color}`); expect(langNameStyles.fill).toBe(`#${themes.radical.text_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes.radical.bg_color}` `#${themes.radical.bg_color}`,
); );
}); });
@@ -180,7 +180,7 @@ describe("Test renderTopLanguages", () => {
expect(langNameStyles.fill).toBe(`#${themes[name].text_color}`); expect(langNameStyles.fill).toBe(`#${themes[name].text_color}`);
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
"fill", "fill",
`#${themes[name].bg_color}` `#${themes[name].bg_color}`,
); );
}); });
}); });
@@ -189,31 +189,31 @@ describe("Test renderTopLanguages", () => {
document.body.innerHTML = renderTopLanguages(langs, { layout: "compact" }); document.body.innerHTML = renderTopLanguages(langs, { layout: "compact" });
expect(queryByTestId(document.body, "header")).toHaveTextContent( expect(queryByTestId(document.body, "header")).toHaveTextContent(
"Most Used Languages" "Most Used Languages",
); );
expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent(
"HTML 40.00%" "HTML 40.00%",
); );
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
"width", "width",
"120.00" "120.00",
); );
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
"javascript 40.00%" "javascript 40.00%",
); );
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
"width", "width",
"120.00" "120.00",
); );
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent( expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
"css 20.00%" "css 20.00%",
); );
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute( expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
"width", "width",
"60.00" "60.00",
); );
}); });
}); });
+1 -1
View File
@@ -9,7 +9,7 @@ const fetcher = jest.fn((variables, token) => {
const fetcherFail = jest.fn(() => { const fetcherFail = jest.fn(() => {
return new Promise((res, rej) => return new Promise((res, rej) =>
res({ data: { errors: [{ type: "RATE_LIMITED" }] } }) res({ data: { errors: [{ type: "RATE_LIMITED" }] } }),
); );
}); });
+1 -1
View File
@@ -118,7 +118,7 @@ describe("Test /api/top-langs", () => {
icon_color: "fff", icon_color: "fff",
text_color: "fff", text_color: "fff",
bg_color: "fff", bg_color: "fff",
}) }),
); );
}); });
+8 -8
View File
@@ -23,24 +23,24 @@ describe("Test utils.js", () => {
it("should test encodeHTML", () => { it("should test encodeHTML", () => {
expect(encodeHTML(`<html>hello world<,.#4^&^@%!))`)).toBe( expect(encodeHTML(`<html>hello world<,.#4^&^@%!))`)).toBe(
"&#60;html&#62;hello world&#60;,.#4^&#38;^@%!))" "&#60;html&#62;hello world&#60;,.#4^&#38;^@%!))",
); );
}); });
it("should test renderError", () => { it("should test renderError", () => {
document.body.innerHTML = renderError("Something went wrong"); document.body.innerHTML = renderError("Something went wrong");
expect( expect(
queryByTestId(document.body, "message").children[0] queryByTestId(document.body, "message").children[0],
).toHaveTextContent(/Something went wrong/gim); ).toHaveTextContent(/Something went wrong/gim);
expect(queryByTestId(document.body, "message").children[1]).toBeEmpty(2); expect(queryByTestId(document.body, "message").children[1]).toBeEmpty(2);
// Secondary message // Secondary message
document.body.innerHTML = renderError( document.body.innerHTML = renderError(
"Something went wrong", "Something went wrong",
"Secondary Message" "Secondary Message",
); );
expect( expect(
queryByTestId(document.body, "message").children[1] queryByTestId(document.body, "message").children[1],
).toHaveTextContent(/Secondary Message/gim); ).toHaveTextContent(/Secondary Message/gim);
}); });
@@ -51,7 +51,7 @@ describe("Test utils.js", () => {
}).join(""); }).join("");
expect(layout).toBe( expect(layout).toBe(
`<g transform=\"translate(0, 0)\"><text>1</text></g><g transform=\"translate(60, 0)\"><text>2</text></g>` `<g transform=\"translate(0, 0)\"><text>1</text></g><g transform=\"translate(60, 0)\"><text>2</text></g>`,
); );
const columns = FlexLayout({ const columns = FlexLayout({
@@ -61,7 +61,7 @@ describe("Test utils.js", () => {
}).join(""); }).join("");
expect(columns).toBe( expect(columns).toBe(
`<g transform=\"translate(0, 0)\"><text>1</text></g><g transform=\"translate(0, 60)\"><text>2</text></g>` `<g transform=\"translate(0, 0)\"><text>1</text></g><g transform=\"translate(0, 60)\"><text>2</text></g>`,
); );
}); });
@@ -121,7 +121,7 @@ describe("wrapTextMultiline", () => {
let multiLineText = wrapTextMultiline( let multiLineText = wrapTextMultiline(
"Hello world long long long text", "Hello world long long long text",
20, 20,
3 3,
); );
expect(multiLineText).toEqual(["Hello world long", "long long text"]); expect(multiLineText).toEqual(["Hello world long", "long long text"]);
}); });
@@ -129,7 +129,7 @@ describe("wrapTextMultiline", () => {
let multiLineText = wrapTextMultiline( let multiLineText = wrapTextMultiline(
"Hello world long long long text", "Hello world long long long text",
10, 10,
2 2,
); );
expect(multiLineText).toEqual(["Hello", "world long..."]); expect(multiLineText).toEqual(["Hello", "world long..."]);
}); });
+4 -4
View File
@@ -89,7 +89,7 @@ const themes = {
text_color: "273849", text_color: "273849",
bg_color: "fffefe", bg_color: "fffefe",
}, },
'vue-dark': { "vue-dark": {
title_color: "41b883", title_color: "41b883",
icon_color: "41b883", icon_color: "41b883",
text_color: "fffefe", text_color: "fffefe",
@@ -161,13 +161,13 @@ const themes = {
text_color: "fff", text_color: "fff",
bg_color: "000", bg_color: "000",
}, },
"nord": { nord: {
title_color: "81a1c1", title_color: "81a1c1",
text_color: "d8dee9", text_color: "d8dee9",
icon_color: "88c0d0", icon_color: "88c0d0",
bg_color: "2e3440", bg_color: "2e3440",
}, },
"gotham": { gotham: {
title_color: "2aa889", title_color: "2aa889",
icon_color: "599cab", icon_color: "599cab",
text_color: "99d1ce", text_color: "99d1ce",
@@ -179,7 +179,7 @@ const themes = {
text_color: "a6accd", text_color: "a6accd",
bg_color: "292d3e", bg_color: "292d3e",
}, },
"graywhite": { graywhite: {
title_color: "24292e", title_color: "24292e",
icon_color: "24292e", icon_color: "24292e",
text_color: "24292e", text_color: "24292e",