Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous 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");
});
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

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