From 68fc4fe45b1b828781f078314ac2c8b909362444 Mon Sep 17 00:00:00 2001 From: picklesrus Date: Tue, 5 Nov 2019 20:01:35 -0500 Subject: [PATCH] Fix merge conflicts :( --- src/components/join-flow/email-step.jsx | 8 -------- src/components/join-flow/join-flow.jsx | 4 ---- .../join-flow/registration-error-step.jsx | 5 ----- test/unit/components/email-step.test.jsx | 17 ++++++---------- .../registration-error-step.test.jsx | 8 -------- test/unit/components/username-step.test.jsx | 20 +++---------------- 6 files changed, 9 insertions(+), 53 deletions(-) diff --git a/src/components/join-flow/email-step.jsx b/src/components/join-flow/email-step.jsx index 20845e1cb..6bcca7305 100644 --- a/src/components/join-flow/email-step.jsx +++ b/src/components/join-flow/email-step.jsx @@ -234,15 +234,7 @@ EmailStep.propTypes = { intl: intlShape, onCaptchaError: PropTypes.func, onNextStep: PropTypes.func, -<<<<<<< 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/join-flow.jsx b/src/components/join-flow/join-flow.jsx index 52454e6b9..fd6760da6 100644 --- a/src/components/join-flow/join-flow.jsx +++ b/src/components/join-flow/join-flow.jsx @@ -233,12 +233,8 @@ 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 d7eb5618c..a7151840d 100644 --- a/src/components/join-flow/registration-error-step.jsx +++ b/src/components/join-flow/registration-error-step.jsx @@ -65,17 +65,12 @@ 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/test/unit/components/email-step.test.jsx b/test/unit/components/email-step.test.jsx index 753f253d7..3f2c866d0 100644 --- a/test/unit/components/email-step.test.jsx +++ b/test/unit/components/email-step.test.jsx @@ -236,9 +236,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => { test('validateEmailRemotelyWithCache calls validate.validateEmailRemotely', done => { const intlWrapper = shallowWithIntl( - ); + + ); const instance = intlWrapper.dive().instance(); instance.validateEmailRemotelyWithCache('some-email@some-domain.com') @@ -252,10 +251,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => { test('validateEmailRemotelyWithCache, called twice with different data, makes two remote requests', done => { const intlWrapper = shallowWithIntl( - ); - + + ); const instance = intlWrapper.dive().instance(); instance.validateEmailRemotelyWithCache('some-email@some-domain.com') @@ -278,10 +275,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => { test('validateEmailRemotelyWithCache, called twice with same data, only makes one remote request', done => { const intlWrapper = shallowWithIntl( - ); - + + ); const instance = intlWrapper.dive().instance(); instance.validateEmailRemotelyWithCache('some-email@some-domain.com') diff --git a/test/unit/components/registration-error-step.test.jsx b/test/unit/components/registration-error-step.test.jsx index f160c9b41..42848bf1b 100644 --- a/test/unit/components/registration-error-step.test.jsx +++ b/test/unit/components/registration-error-step.test.jsx @@ -10,19 +10,13 @@ describe('RegistrationErrorStep', () => { const getRegistrationErrorStepWrapper = props => { const wrapper = shallowWithIntl( >>>>>> Add analytics logging to join flow. Adding page views for each step in the flow. {...props} /> ); return wrapper .dive(); // unwrap injectIntl() }; -<<<<<<< HEAD test('registrationError has JoinFlowStep', () => { const props = { @@ -69,7 +63,6 @@ describe('RegistrationErrorStep', () => { expect(errMsgElement).toHaveLength(0); }); -======= test('logs to analytics', () => { const analyticsFn = jest.fn(); mountWithIntl( @@ -78,7 +71,6 @@ describe('RegistrationErrorStep', () => { />); 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, diff --git a/test/unit/components/username-step.test.jsx b/test/unit/components/username-step.test.jsx index 56e34588d..873b015de 100644 --- a/test/unit/components/username-step.test.jsx +++ b/test/unit/components/username-step.test.jsx @@ -34,17 +34,14 @@ jest.mock('../../../src/lib/validate.js', () => ( // must come after validation mocks, so validate.js will be mocked before it is required const UsernameStep = require('../../../src/components/join-flow/username-step.jsx'); -<<<<<<< HEAD + describe('UsernameStep tests', () => { -======= -describe('UsernameStep test', () => { const defaultProps = () => ({ sendAnalytics: jest.fn() }); afterEach(() => { jest.clearAllMocks(); }); ->>>>>>> Add analytics logging to join flow. Adding page views for each step in the flow. test('send correct props to formik', () => { const wrapper = shallowWithIntl( { -<<<<<<< HEAD const wrapper = shallowWithIntl(); -======= - const wrapper = shallowWithIntl( - ); ->>>>>>> Add analytics logging to join flow. Adding page views for each step in the flow. const instance = wrapper.dive().instance(); instance.validateUsernameRemotelyWithCache('newUniqueUsername55') @@ -133,9 +123,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () = test('validateUsernameRemotelyWithCache, called twice with different data, makes two remote requests', done => { const wrapper = shallowWithIntl( - + ); const instance = wrapper.dive().instance(); @@ -161,9 +149,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () = test('validateUsernameRemotelyWithCache, called twice with same data, only makes one remote request', done => { const wrapper = shallowWithIntl( - + ); const instance = wrapper.dive().instance();