mirror of
https://github.com/anuraghazra/github-readme-stats.git
synced 2025-01-12 13:41:40 +08:00
94aeabe300
* Add wakatime compact layout * Update readme * test: added & updated test snapshots Co-authored-by: Anurag <hazru.anurag@gmail.com>
30 lines
920 B
JavaScript
30 lines
920 B
JavaScript
require("@testing-library/jest-dom");
|
|
const renderWakatimeCard = require("../src/cards/wakatime-card");
|
|
|
|
const { wakaTimeData } = require("./fetchWakatime.test");
|
|
|
|
describe("Test Render Wakatime Card", () => {
|
|
it("should render correctly", () => {
|
|
const card = renderWakatimeCard(wakaTimeData.data);
|
|
|
|
expect(card).toMatchSnapshot();
|
|
});
|
|
|
|
it("should render correctly with compact layout", () => {
|
|
const card = renderWakatimeCard(wakaTimeData.data, { layout: "compact" });
|
|
|
|
expect(card).toMatchSnapshot();
|
|
});
|
|
|
|
it("should render translations", () => {
|
|
document.body.innerHTML = renderWakatimeCard({}, { locale: "cn" });
|
|
expect(document.getElementsByClassName("header")[0].textContent).toBe(
|
|
"Wakatime 周统计",
|
|
);
|
|
expect(
|
|
document.querySelector('g[transform="translate(0, 0)"]>text.stat.bold')
|
|
.textContent,
|
|
).toBe("本周没有编程活动");
|
|
});
|
|
});
|