From c8e9ea3519ce5c0532c12c4d239293a3b5d4f773 Mon Sep 17 00:00:00 2001 From: Josh Swan Date: Wed, 12 Feb 2020 20:09:46 -0800 Subject: [PATCH] feat: support alt narrow currency symbol `FormattedCurrency` (and `getCurrencyFormatter`) support `symbolForm` option to allow usage of alt narrow currency symbol closes #34 --- src/components/FormattedCurrency.tsx | 1 + .../__tests__/FormattedCurrency.test.tsx | 14 ++++++++++++++ .../__snapshots__/FormattedCurrency.test.tsx.snap | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/components/FormattedCurrency.tsx b/src/components/FormattedCurrency.tsx index 7184e45..48b936a 100644 --- a/src/components/FormattedCurrency.tsx +++ b/src/components/FormattedCurrency.tsx @@ -18,6 +18,7 @@ export interface FormattedCurrencyProps extends Omit', () => { expect(tree).toMatchSnapshot(); }); + + describe('symbolForm', () => { + test('supports symbolForm prop to use alt narrow currency symbol', () => { + const tree = createWithGlobalize(( + + )).toJSON(); + + expect(tree).toMatchSnapshot(); + }); + }); }); diff --git a/src/components/__tests__/__snapshots__/FormattedCurrency.test.tsx.snap b/src/components/__tests__/__snapshots__/FormattedCurrency.test.tsx.snap index 40c940d..758c996 100644 --- a/src/components/__tests__/__snapshots__/FormattedCurrency.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/FormattedCurrency.test.tsx.snap @@ -10,3 +10,14 @@ exports[` renders correctly 1`] = ` $10.00 `; + +exports[` symbolForm supports symbolForm prop to use alt narrow currency symbol 1`] = ` + + $10.00 + +`;