diff --git a/components/atoms/Stepper/Forms/__snapshots__/payment2.test.js.snap b/components/atoms/Stepper/Forms/__snapshots__/payment2.test.js.snap new file mode 100644 index 0000000..7ff696a --- /dev/null +++ b/components/atoms/Stepper/Forms/__snapshots__/payment2.test.js.snap @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Payment2 component renders the component without crashing 1`] = ` +Object { + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "logTestingPlaygroundURL": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], +} +`; diff --git a/components/atoms/Stepper/Forms/payment2.js b/components/atoms/Stepper/Forms/payment2.js index bfa7b58..ed28aea 100644 --- a/components/atoms/Stepper/Forms/payment2.js +++ b/components/atoms/Stepper/Forms/payment2.js @@ -269,9 +269,9 @@ function Amount({ ); const [currencyPatientName, setCurrencyPatientName] = useState( patient.countryLabel ?? - new Intl.DisplayNames(['en'], { type: 'region' }).of( - patient?.country?.toUpperCase(), - ), + new Intl.DisplayNames(['en'], { type: 'region' }).of( + patient?.country?.toUpperCase(), + ), ); const [currencySender, setCurrencySender] = useState('EUR'); @@ -380,9 +380,8 @@ function Amount({ Pays:{' '} cd { + it('renders the component without crashing', () => { + + fetch.mockResponse('{}'); + + jest.spyOn(window.localStorage.__proto__, 'getItem').mockReturnValue(JSON.stringify({ + firstName: 'John', + amount: 123, + })); + + render( + + + + + + + + ); + expect(screen).toMatchSnapshot(); + }); +});