Unverified Commit 922f7165 authored by Anurag Hazra's avatar Anurag Hazra Committed by GitHub
Browse files

test: fix broken tests (#926)

parent c8a5e835
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -234,33 +234,33 @@ describe("Test renderStatsCard", () => {
  it("should render translations", () => {
    document.body.innerHTML = renderStatsCard(stats, { locale: "cn" });
    expect(document.getElementsByClassName("header")[0].textContent).toBe(
      "Anurag Hazra 的 GitHub 统计",
      "Anurag Hazra 的 GitHub 统计数据",
    );
    expect(
      document.querySelector(
        'g[transform="translate(0, 0)"]>.stagger>.stat.bold',
      ).textContent,
    ).toBe("获标星(star):");
    ).toMatchInlineSnapshot(`"获标星(star):"`);
    expect(
      document.querySelector(
        'g[transform="translate(0, 25)"]>.stagger>.stat.bold',
      ).textContent,
    ).toBe(`累计提交(commit) (${new Date().getFullYear()}):`);
    ).toMatchInlineSnapshot(`"累计提交(commit) (2021):"`);
    expect(
      document.querySelector(
        'g[transform="translate(0, 50)"]>.stagger>.stat.bold',
      ).textContent,
    ).toBe("提案数(PR):");
    ).toMatchInlineSnapshot(`"拉取请求数(PR):"`);
    expect(
      document.querySelector(
        'g[transform="translate(0, 75)"]>.stagger>.stat.bold',
      ).textContent,
    ).toBe("指出问题(issue):");
    ).toMatchInlineSnapshot(`"指出问题(issue):"`);
    expect(
      document.querySelector(
        'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
      ).textContent,
    ).toBe("参与项目数:");
    ).toMatchInlineSnapshot(`"参与项目数:"`);
  });

  it("should render without rounding", () => {