mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-19 14:27:09 +00:00
tests:: allow gradient themes (#3401)
This commit is contained in:
parent
f8aa2db39d
commit
3977b905b8
4 changed files with 16 additions and 12 deletions
|
|
@ -135,9 +135,10 @@ describe("test renderGistCard", () => {
|
|||
);
|
||||
expect(descClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
|
||||
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
`#${themes[name].bg_color}`,
|
||||
const backgroundElement = queryByTestId(document.body, "card-bg");
|
||||
const backgroundElementFill = backgroundElement.getAttribute("fill");
|
||||
expect([`#${themes[name].bg_color}`, "url(#gradient)"]).toContain(
|
||||
backgroundElementFill,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -190,9 +190,10 @@ describe("Test renderRepoCard", () => {
|
|||
);
|
||||
expect(descClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
|
||||
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
`#${themes[name].bg_color}`,
|
||||
const backgroundElement = queryByTestId(document.body, "card-bg");
|
||||
const backgroundElementFill = backgroundElement.getAttribute("fill");
|
||||
expect([`#${themes[name].bg_color}`, "url(#gradient)"]).toContain(
|
||||
backgroundElementFill,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -264,9 +264,10 @@ describe("Test renderStatsCard", () => {
|
|||
);
|
||||
expect(statClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
|
||||
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
`#${themes[name].bg_color}`,
|
||||
const backgroundElement = queryByTestId(document.body, "card-bg");
|
||||
const backgroundElementFill = backgroundElement.getAttribute("fill");
|
||||
expect([`#${themes[name].bg_color}`, "url(#gradient)"]).toContain(
|
||||
backgroundElementFill,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -524,9 +524,10 @@ describe("Test renderTopLanguages", () => {
|
|||
|
||||
expect(headerStyles.fill.trim()).toBe(`#${themes[name].title_color}`);
|
||||
expect(langNameStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
|
||||
expect(queryByTestId(document.body, "card-bg")).toHaveAttribute(
|
||||
"fill",
|
||||
`#${themes[name].bg_color}`,
|
||||
const backgroundElement = queryByTestId(document.body, "card-bg");
|
||||
const backgroundElementFill = backgroundElement.getAttribute("fill");
|
||||
expect([`#${themes[name].bg_color}`, "url(#gradient)"]).toContain(
|
||||
backgroundElementFill,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue