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:
Bas950
2020-09-24 21:38:14 +05:30
committed by GitHub
co-authored by Anurag Hazra
parent 3c6c142c75
commit 8aea1e3c35
35 changed files with 152 additions and 134 deletions
+12 -12
View File
@@ -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");
});
});