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

Commit922f716

Browse files
authored
test: fix broken tests (anuraghazra#926)
1 parentc8a5e83 commit922f716

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎tests/renderStatsCard.test.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,39 +234,39 @@ describe("Test renderStatsCard", () => {
234234
it("should render translations",()=>{
235235
document.body.innerHTML=renderStatsCard(stats,{locale:"cn"});
236236
expect(document.getElementsByClassName("header")[0].textContent).toBe(
237-
"Anurag Hazra 的 GitHub统计",
237+
"Anurag Hazra 的 GitHub统计数据",
238238
);
239239
expect(
240240
document.querySelector(
241241
'g[transform="translate(0, 0)"]>.stagger>.stat.bold',
242242
).textContent,
243-
).toBe("获标星(star):");
243+
).toMatchInlineSnapshot(`"获标星数(star):"`);
244244
expect(
245245
document.querySelector(
246246
'g[transform="translate(0, 25)"]>.stagger>.stat.bold',
247247
).textContent,
248-
).toBe(`累计提交(commit) (${newDate().getFullYear()}):`);
248+
).toMatchInlineSnapshot(`"累计提交数(commit) (2021):"`);
249249
expect(
250250
document.querySelector(
251251
'g[transform="translate(0, 50)"]>.stagger>.stat.bold',
252252
).textContent,
253-
).toBe("提案数(PR):");
253+
).toMatchInlineSnapshot(`"拉取请求数(PR):"`);
254254
expect(
255255
document.querySelector(
256256
'g[transform="translate(0, 75)"]>.stagger>.stat.bold',
257257
).textContent,
258-
).toBe("指出问题(issue):");
258+
).toMatchInlineSnapshot(`"指出问题数(issue):"`);
259259
expect(
260260
document.querySelector(
261261
'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
262262
).textContent,
263-
).toBe("参与项目数:");
263+
).toMatchInlineSnapshot(`"参与项目数:"`);
264264
});
265265

266266
it("should render without rounding",()=>{
267267
document.body.innerHTML=renderStatsCard(stats,{border_radius:"0"});
268268
expect(document.querySelector("rect")).toHaveAttribute("rx","0");
269-
document.body.innerHTML=renderStatsCard(stats,{});
269+
document.body.innerHTML=renderStatsCard(stats,{});
270270
expect(document.querySelector("rect")).toHaveAttribute("rx","4.5");
271271
});
272272
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp