From f5a1e01efe51502cb54871355e18a1a06cd9085c Mon Sep 17 00:00:00 2001 From: Denis Badurina Date: Thu, 14 May 2020 16:05:03 +0200 Subject: [PATCH] test(FormNumberField): failing prefix/suffix props --- .../__tests__/FormNumberField.test.tsx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/packages/react-form/__tests__/FormNumberField.test.tsx b/packages/react-form/__tests__/FormNumberField.test.tsx index 3473db35..282767a4 100644 --- a/packages/react-form/__tests__/FormNumberField.test.tsx +++ b/packages/react-form/__tests__/FormNumberField.test.tsx @@ -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) => {