Skip to content

Commit

Permalink
test(FormNumberField): failing prefix/suffix props
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed May 15, 2020
1 parent 00f01f9 commit f982173
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions packages/react-form/__tests__/FormNumberField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,48 @@ it.each([
type: '54321,54',
expected: '54.321,54',
}),
// 16
createCase({
props: {
prefix: '$',
},
type: '12,34',
expected: '$12.34',
}),
// 17
createCase({
props: {
prefix: '$',
},
type: ' ',
expected: '',
}),
// 18
createCase({
props: {
suffix: '%',
},
type: '12,34',
expected: '12.34%',
}),
// 19
createCase({
props: {
suffix: '%',
},
type: ' ',
expected: '',
}),
// 20
createCase({
props: {
prefix: '$',
suffix: '%',
padFractionalZeros: true,
},
type: ' 1 ',
expected: '$1.00%',
}),
])(
"should have '%s' when %o with props %j (case index %#)",
async (expected, { type, allAtOnce }, props) => {
Expand Down

0 comments on commit f982173

Please sign in to comment.