Skip to content
Prev Previous commit
Next Next commit
test(wallet): cover a cut that leaves only zeros
  • Loading branch information
askalf committed Oct 5, 2026
commit 99429853dcd52593841b6f1074ab598967cb997b
4 changes: 4 additions & 0 deletions src/main/wallet-balances.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ describe("formatTokenBalanceFull", () => {
expect(formatTokenBalanceFull("1200010000000000000", 18)).toBe("1.2");
});

it("drops the fraction when the cut leaves only zeros", () => {
expect(formatTokenBalanceFull("1000010000000000000", 18)).toBe("1");
});

it("trims zeros exposed by the cut below 1", () => {
// 0.0001200005 tokens → "0.00012"
expect(formatTokenBalanceFull("120000500000000", 18)).toBe("0.00012");
Expand Down
Loading