mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-13 16:22:46 +00:00
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:
@@ -24,11 +24,11 @@ describe("Test renderStatsCard", () => {
|
||||
document.body.innerHTML = renderStatsCard(stats);
|
||||
|
||||
expect(document.getElementsByClassName("header")[0].textContent).toBe(
|
||||
"Anurag Hazra's GitHub Stats"
|
||||
"Anurag Hazra's GitHub Stats",
|
||||
);
|
||||
|
||||
expect(
|
||||
document.body.getElementsByTagName("svg")[0].getAttribute("height")
|
||||
document.body.getElementsByTagName("svg")[0].getAttribute("height"),
|
||||
).toBe("195");
|
||||
expect(getByTestId(document.body, "stars").textContent).toBe("100");
|
||||
expect(getByTestId(document.body, "commits").textContent).toBe("200");
|
||||
@@ -43,13 +43,13 @@ describe("Test renderStatsCard", () => {
|
||||
document.body.innerHTML = renderStatsCard({ ...stats, name: "Anil Das" });
|
||||
|
||||
expect(document.getElementsByClassName("header")[0].textContent).toBe(
|
||||
"Anil Das' GitHub Stats"
|
||||
"Anil Das' GitHub Stats",
|
||||
);
|
||||
|
||||
document.body.innerHTML = renderStatsCard({ ...stats, name: "Felix" });
|
||||
|
||||
expect(document.getElementsByClassName("header")[0].textContent).toBe(
|
||||
"Felix' GitHub Stats"
|
||||
"Felix' GitHub Stats",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ describe("Test renderStatsCard", () => {
|
||||
});
|
||||
|
||||
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.
|
||||
|
||||
expect(queryByTestId(document.body, "stars")).toBeDefined();
|
||||
@@ -90,7 +90,7 @@ describe("Test renderStatsCard", () => {
|
||||
expect(iconClassStyles.fill).toBe("#4c71f2");
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
"#fffefe"
|
||||
"#fffefe",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -116,7 +116,7 @@ describe("Test renderStatsCard", () => {
|
||||
expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
"#252525"
|
||||
"#252525",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -138,7 +138,7 @@ describe("Test renderStatsCard", () => {
|
||||
expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"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(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"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(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
`#${themes.radical.bg_color}`
|
||||
`#${themes.radical.bg_color}`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -196,7 +196,7 @@ describe("Test renderStatsCard", () => {
|
||||
expect(queryAllByTestId(document.body, "icon")[0]).toBeDefined();
|
||||
expect(queryByTestId(document.body, "stars")).toBeDefined();
|
||||
expect(
|
||||
queryByTestId(document.body, "stars").previousElementSibling // the label
|
||||
queryByTestId(document.body, "stars").previousElementSibling, // the label
|
||||
).toHaveAttribute("x", "25");
|
||||
});
|
||||
|
||||
@@ -206,7 +206,7 @@ describe("Test renderStatsCard", () => {
|
||||
expect(queryAllByTestId(document.body, "icon")[0]).not.toBeDefined();
|
||||
expect(queryByTestId(document.body, "stars")).toBeDefined();
|
||||
expect(
|
||||
queryByTestId(document.body, "stars").previousElementSibling // the label
|
||||
queryByTestId(document.body, "stars").previousElementSibling, // the label
|
||||
).not.toHaveAttribute("x");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user