feat: implement number precision parameter for stats card (#4514)
* Update short number format Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999 * review * Update src/common/utils.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * dev * dev --------- Co-authored-by: Alexandr <qwerty541zxc@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
Alexandr
parent
7caaa21e73
commit
4143c6dec3
@@ -416,6 +416,13 @@ describe("Test renderStatsCard", () => {
|
||||
expect(getByTestId(document.body, "commits").textContent).toBe("2k");
|
||||
document.body.innerHTML = renderStatsCard(stats, { number_format: "long" });
|
||||
expect(getByTestId(document.body, "commits").textContent).toBe("1999");
|
||||
document.body.innerHTML = renderStatsCard(stats, { number_precision: 2 });
|
||||
expect(getByTestId(document.body, "commits").textContent).toBe("2.00k");
|
||||
document.body.innerHTML = renderStatsCard(stats, {
|
||||
number_format: "long",
|
||||
number_precision: 2,
|
||||
});
|
||||
expect(getByTestId(document.body, "commits").textContent).toBe("1999");
|
||||
});
|
||||
|
||||
it("should render default rank icon with level A+", () => {
|
||||
|
||||
Reference in New Issue
Block a user