Improve coverage of Amount component
annybs opened this issue · comments
Anny commented
There is a mix of <Amount/>
components and manual {{ formatCurrency(amount) }}
calls in modals. Ideally all monetary values should be represented through the component, but it has scoped styles that affect appearance when misused.
Some possible approaches:
- Add a flag to the component to disable styling (I experimented with a
sub
boolean to toggle sub/span with unsatisfactory results) - Remove styling from the component and reapply in parent component where appropriate
- Just don't, and say we did
Anny commented
Additionally, the component should handle different types of value
as follows:
undefined
-> placeholder value (currently "...")NaN
-> emdash placeholder (—)String
-> as-is (assumed preformatted)Number
-> per current implementation