refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -22,11 +22,18 @@ describe("shared display helpers", () => {
|
||||
);
|
||||
expect(formatMoney({ currency: "RUB", value: "10" })).toBe("10 ₽");
|
||||
expect(formatMoney({ currency: "USD", value: "0.5" })).toBe("0,5 USD");
|
||||
expect(formatMoney({ currency: "RUB", value: "0001234.50" })).toBe("0 001 234,50 ₽");
|
||||
expect(formatMoney({ currency: "RUB", value: "123456789012345678901234567890.01" })).toBe(
|
||||
"123 456 789 012 345 678 901 234 567 890,01 ₽",
|
||||
expect(formatMoney({ currency: "RUB", value: "0001234.50" })).toBe(
|
||||
"0 001 234,50 ₽",
|
||||
);
|
||||
expect(formatMoney({ currency: "RUB", value: "1.5" }, { withZeroCents: true })).toBe("1,50 ₽");
|
||||
expect(
|
||||
formatMoney({
|
||||
currency: "RUB",
|
||||
value: "123456789012345678901234567890.01",
|
||||
}),
|
||||
).toBe("123 456 789 012 345 678 901 234 567 890,01 ₽");
|
||||
expect(
|
||||
formatMoney({ currency: "RUB", value: "1.5" }, { withZeroCents: true }),
|
||||
).toBe("1,50 ₽");
|
||||
expect(formatMoney(null)).toBe("—");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user