diff --git a/src/components/join-flow/birthdate-step.jsx b/src/components/join-flow/birthdate-step.jsx index 25f15e825..ae0920805 100644 --- a/src/components/join-flow/birthdate-step.jsx +++ b/src/components/join-flow/birthdate-step.jsx @@ -167,7 +167,7 @@ class BirthDateStep extends React.Component { BirthDateStep.propTypes = { intl: intlShape, onNextStep: PropTypes.func, - sendAnalytics: PropTypes.func + sendAnalytics: PropTypes.func.isRequired }; const IntlBirthDateStep = injectIntl(BirthDateStep); diff --git a/src/components/join-flow/country-step.jsx b/src/components/join-flow/country-step.jsx index 0cec8e070..a95b97536 100644 --- a/src/components/join-flow/country-step.jsx +++ b/src/components/join-flow/country-step.jsx @@ -122,7 +122,7 @@ class CountryStep extends React.Component { CountryStep.propTypes = { intl: intlShape, onNextStep: PropTypes.func, - sendAnalytics: PropTypes.func + sendAnalytics: PropTypes.func.isRequired }; const IntlCountryStep = injectIntl(CountryStep); diff --git a/src/components/join-flow/email-step.jsx b/src/components/join-flow/email-step.jsx index 0dc91a17f..26cc90297 100644 --- a/src/components/join-flow/email-step.jsx +++ b/src/components/join-flow/email-step.jsx @@ -235,8 +235,12 @@ EmailStep.propTypes = { <<<<<<< HEAD ======= onRegistrationError: PropTypes.func, +<<<<<<< HEAD sendAnalytics: PropTypes.func, >>>>>>> Add analytics logging to join flow. Adding page views for each step in the flow. +======= + sendAnalytics: PropTypes.func.isRequired, +>>>>>>> Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step. waiting: PropTypes.bool }; diff --git a/src/components/join-flow/gender-step.jsx b/src/components/join-flow/gender-step.jsx index 1aaec2ca8..053034139 100644 --- a/src/components/join-flow/gender-step.jsx +++ b/src/components/join-flow/gender-step.jsx @@ -184,7 +184,7 @@ class GenderStep extends React.Component { GenderStep.propTypes = { intl: intlShape, onNextStep: PropTypes.func, - sendAnalytics: PropTypes.func + sendAnalytics: PropTypes.func.isRequired }; module.exports = injectIntl(GenderStep); diff --git a/src/components/join-flow/join-flow.jsx b/src/components/join-flow/join-flow.jsx index 193e849fb..52454e6b9 100644 --- a/src/components/join-flow/join-flow.jsx +++ b/src/components/join-flow/join-flow.jsx @@ -233,7 +233,12 @@ class JoinFlow extends React.Component { {this.state.registrationError ? ( >>>>>> Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step. /* eslint-disable react/jsx-no-bind */ onSubmit={this.handleErrorNext} /* eslint-enable react/jsx-no-bind */ diff --git a/src/components/join-flow/registration-error-step.jsx b/src/components/join-flow/registration-error-step.jsx index d46f50722..160ec1241 100644 --- a/src/components/join-flow/registration-error-step.jsx +++ b/src/components/join-flow/registration-error-step.jsx @@ -63,12 +63,17 @@ RegistrationErrorStep.propTypes = { canTryAgain: PropTypes.bool.isRequired, errorMsg: PropTypes.string, intl: intlShape, +<<<<<<< HEAD onSubmit: PropTypes.func.isRequired, sendAnalytics: PropTypes.func.isRequired }; RegistrationErrorStep.defaultProps = { canTryAgain: false +======= + onSubmit: PropTypes.func, + sendAnalytics: PropTypes.func.isRequired +>>>>>>> Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step. }; const IntlRegistrationErrorStep = injectIntl(RegistrationErrorStep); diff --git a/src/components/join-flow/username-step.jsx b/src/components/join-flow/username-step.jsx index 918689edc..5405678bd 100644 --- a/src/components/join-flow/username-step.jsx +++ b/src/components/join-flow/username-step.jsx @@ -289,7 +289,7 @@ class UsernameStep extends React.Component { UsernameStep.propTypes = { intl: intlShape, onNextStep: PropTypes.func, - sendAnalytics: PropTypes.func + sendAnalytics: PropTypes.func.isRequired }; const IntlUsernameStep = injectIntl(UsernameStep); diff --git a/test/unit/components/registration-error-step.test.jsx b/test/unit/components/registration-error-step.test.jsx index 519af9f20..f160c9b41 100644 --- a/test/unit/components/registration-error-step.test.jsx +++ b/test/unit/components/registration-error-step.test.jsx @@ -1,5 +1,6 @@ import React from 'react'; import {shallowWithIntl} from '../../helpers/intl-helpers.jsx'; +import {mountWithIntl} from '../../helpers/intl-helpers.jsx'; import JoinFlowStep from '../../../src/components/join-flow/join-flow-step'; import RegistrationErrorStep from '../../../src/components/join-flow/registration-error-step'; @@ -21,6 +22,7 @@ describe('RegistrationErrorStep', () => { return wrapper .dive(); // unwrap injectIntl() }; +<<<<<<< HEAD test('registrationError has JoinFlowStep', () => { const props = { @@ -67,6 +69,16 @@ describe('RegistrationErrorStep', () => { expect(errMsgElement).toHaveLength(0); }); +======= + test('logs to analytics', () => { + const analyticsFn = jest.fn(); + mountWithIntl( + ); + expect(analyticsFn).toHaveBeenCalledWith('join-error'); + }); +>>>>>>> Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step. test('when canTryAgain is true, show tryAgain message', () => { const props = { canTryAgain: true,