Update proptypes

This commit is contained in:
Jenni Nurmi 2019-05-13 10:47:04 +03:00
parent a78777a85b
commit fcc932441e
6 changed files with 12 additions and 8 deletions

View file

@ -516,6 +516,8 @@ CheckoutPageComponent.defaultProps = {
enquiredTransaction: null,
currentUser: null,
stripePaymentToken: null,
stripePaymentTokenInProgress: false,
stripePaymentTokenError: null,
};
CheckoutPageComponent.propTypes = {
@ -539,8 +541,8 @@ CheckoutPageComponent.propTypes = {
}).isRequired,
sendOrderRequest: func.isRequired,
onCreateStripePaymentToken: func.isRequired,
stripePaymentTokenInProgress: bool.isRequired,
stripePaymentTokenError: bool.isRequired,
stripePaymentTokenInProgress: bool,
stripePaymentTokenError: propTypes.error,
stripePaymentToken: object,
// from connect

View file

@ -26,7 +26,7 @@ describe('CheckoutPage', () => {
scrollingDisabled: false,
onCreateStripePaymentToken: noop,
stripePaymentTokenInProgress: false,
stripePaymentTokenError: false,
stripePaymentTokenError: null,
};
const tree = renderShallow(<CheckoutPageComponent {...props} />);
expect(tree).toMatchSnapshot();

View file

@ -95,7 +95,7 @@ exports[`CheckoutPage matches snapshot 1`] = `
paymentInfo="CheckoutPage.paymentInfo"
showInitialMessageInput={true}
stripePaymentToken={null}
stripePaymentTokenError={false}
stripePaymentTokenError={null}
stripePaymentTokenInProgress={false}
/>
</section>

View file

@ -34,7 +34,7 @@ const initialState = {
stripeAccount: null,
stripeAccountFetched: false,
stripePaymentTokenInProgress: false,
stripePaymentTokenError: false,
stripePaymentTokenError: null,
stripePaymentToken: null,
};

View file

@ -18,7 +18,7 @@ export const Empty = {
intl: fakeIntl,
onCreateStripePaymentToken: noop,
stripePaymentTokenInProgress: false,
stripePaymentTokenError: false,
stripePaymentTokenError: null,
},
group: 'forms',
};

View file

@ -272,6 +272,8 @@ StripePaymentForm.defaultProps = {
onChange: () => null,
showInitialMessageInput: true,
stripePaymentToken: null,
stripePaymentTokenInProgress: false,
stripePaymentTokenError: null,
};
const { bool, func, string, object } = PropTypes;
@ -288,8 +290,8 @@ StripePaymentForm.propTypes = {
authorDisplayName: string.isRequired,
showInitialMessageInput: bool,
onCreateStripePaymentToken: func.isRequired,
stripePaymentTokenInProgress: bool.isRequired,
stripePaymentTokenError: bool.isRequired,
stripePaymentTokenInProgress: bool,
stripePaymentTokenError: propTypes.error,
stripePaymentToken: object,
};