From 26ad641a02990c7a67362fba3c5ed199a3e3152c Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Mon, 2 Oct 2017 14:19:39 -0500 Subject: [PATCH] fix(payform): fix linting issues --- app/reducers/payform.js | 5 ++--- app/routes/app/containers/AppContainer.js | 4 ++-- test/components/Form.spec.js | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/reducers/payform.js b/app/reducers/payform.js index e71b5aab..b031b8ff 100644 --- a/app/reducers/payform.js +++ b/app/reducers/payform.js @@ -165,9 +165,8 @@ payFormSelectors.payFormIsValid = createSelector( payFormSelectors.isOnchain, payFormSelectors.isLn, payAmountSelector, - payInputSelector, - (isOnchain, isLn, amount, invoice) => { - let errors = {} + (isOnchain, isLn, amount) => { + const errors = {} if (!isLn && amount <= 0) { errors.amount = 'Amount must be more than 0' diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js index 233f4313..7da0a72b 100644 --- a/app/routes/app/containers/AppContainer.js +++ b/app/routes/app/containers/AppContainer.js @@ -83,12 +83,12 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { fetchInvoice: dispatchProps.fetchInvoice, onPayAmountBlur: () => { - // If the input is now valid and showErrors was on, turn it off + // If the amount is now valid and showErrors was on, turn it off if (stateProps.payFormIsValid.amountIsValid && stateProps.payform.showErrors.amount) { dispatchProps.updatePayErrors({ amount: false }) } - // If the input is not valid and showErrors was off, turn it on + // If the amount is not valid and showErrors was off, turn it on if (!stateProps.payFormIsValid.amountIsValid && !stateProps.payform.showErrors.amount) { dispatchProps.updatePayErrors({ amount: true }) } diff --git a/test/components/Form.spec.js b/test/components/Form.spec.js index 3024a3b4..d90556ff 100644 --- a/test/components/Form.spec.js +++ b/test/components/Form.spec.js @@ -15,9 +15,12 @@ const payFormProps = { currentAmount: '0', inputCaption: '', showPayLoadingScreen: false, + payFormIsValid: {}, setPayAmount: () => {}, + onPayAmountBlur: () => {}, setPayInput: () => {}, + onPayInputBlur: () => {}, fetchInvoice: () => {},