Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3977b90

Browse files
authored
tests:: allow gradient themes (anuraghazra#3401)
1 parentf8aa2db commit3977b90

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

‎tests/renderGistCard.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ describe("test renderGistCard", () => {
135135
);
136136
expect(descClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
137137
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
138-
expect(queryByTestId(document.body,"card-bg")).toHaveAttribute(
139-
"fill",
140-
`#${themes[name].bg_color}`,
138+
constbackgroundElement=queryByTestId(document.body,"card-bg");
139+
constbackgroundElementFill=backgroundElement.getAttribute("fill");
140+
expect([`#${themes[name].bg_color}`,"url(#gradient)"]).toContain(
141+
backgroundElementFill,
141142
);
142143
});
143144
});

‎tests/renderRepoCard.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ describe("Test renderRepoCard", () => {
190190
);
191191
expect(descClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
192192
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
193-
expect(queryByTestId(document.body,"card-bg")).toHaveAttribute(
194-
"fill",
195-
`#${themes[name].bg_color}`,
193+
constbackgroundElement=queryByTestId(document.body,"card-bg");
194+
constbackgroundElementFill=backgroundElement.getAttribute("fill");
195+
expect([`#${themes[name].bg_color}`,"url(#gradient)"]).toContain(
196+
backgroundElementFill,
196197
);
197198
});
198199
});

‎tests/renderStatsCard.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,10 @@ describe("Test renderStatsCard", () => {
264264
);
265265
expect(statClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
266266
expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`);
267-
expect(queryByTestId(document.body,"card-bg")).toHaveAttribute(
268-
"fill",
269-
`#${themes[name].bg_color}`,
267+
constbackgroundElement=queryByTestId(document.body,"card-bg");
268+
constbackgroundElementFill=backgroundElement.getAttribute("fill");
269+
expect([`#${themes[name].bg_color}`,"url(#gradient)"]).toContain(
270+
backgroundElementFill,
270271
);
271272
});
272273
});

‎tests/renderTopLanguagesCard.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,10 @@ describe("Test renderTopLanguages", () => {
524524

525525
expect(headerStyles.fill.trim()).toBe(`#${themes[name].title_color}`);
526526
expect(langNameStyles.fill.trim()).toBe(`#${themes[name].text_color}`);
527-
expect(queryByTestId(document.body,"card-bg")).toHaveAttribute(
528-
"fill",
529-
`#${themes[name].bg_color}`,
527+
constbackgroundElement=queryByTestId(document.body,"card-bg");
528+
constbackgroundElementFill=backgroundElement.getAttribute("fill");
529+
expect([`#${themes[name].bg_color}`,"url(#gradient)"]).toContain(
530+
backgroundElementFill,
530531
);
531532
});
532533
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp