From 924c862b9ee4be7148ced9c42998ff4c678207a9 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Thu, 11 Jun 2020 18:25:47 -0400 Subject: [PATCH] remove email opt-in from join flow --- src/components/join-flow/email-step.jsx | 11 +---------- src/components/join-flow/join-flow.jsx | 1 - src/l10n.json | 3 +-- test/unit/components/email-step.test.jsx | 19 ------------------- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/components/join-flow/email-step.jsx b/src/components/join-flow/email-step.jsx index 48fe7dad7..448f3919c 100644 --- a/src/components/join-flow/email-step.jsx +++ b/src/components/join-flow/email-step.jsx @@ -9,7 +9,6 @@ const FormattedMessage = require('react-intl').FormattedMessage; const validate = require('../../lib/validate'); const JoinFlowStep = require('./join-flow-step.jsx'); const FormikInput = require('../../components/formik-forms/formik-input.jsx'); -const FormikCheckbox = require('../../components/formik-forms/formik-checkbox.jsx'); const InfoButton = require('../info-button/info-button.jsx'); const Captcha = require('../../components/captcha/captcha.jsx'); require('./join-flow-steps.scss'); @@ -100,8 +99,7 @@ class EmailStep extends React.Component { return ( -
- -
{ {...defaultProps()} />); const emailStepWrapper = intlWrapper.dive(); - expect(emailStepWrapper.props().initialValues.subscribe).toBe(false); expect(emailStepWrapper.props().initialValues.email).toBe(''); expect(emailStepWrapper.props().validateOnBlur).toBe(false); expect(emailStepWrapper.props().validateOnChange).toBe(false); @@ -94,23 +92,6 @@ describe('EmailStep test', () => { expect(emailInputWrapper.props().validate).toEqual(emailStepWrapper.instance().validateEmail); }); - test('props sent to FormikCheckbox for subscribe', () => { - const intlWrapper = shallowWithIntl(); - - // Dive to get past the intl wrapper - const emailStepWrapper = intlWrapper.dive(); - // Dive to get past the anonymous component. - const joinFlowWrapper = emailStepWrapper.dive().find(JoinFlowStep); - expect(joinFlowWrapper).toHaveLength(1); - const checkboxWrapper = joinFlowWrapper.find(FormikCheckbox).first(); - expect(checkboxWrapper).toHaveLength(1); - expect(checkboxWrapper.first().props().id).toEqual('subscribeCheckbox'); - expect(checkboxWrapper.first().props().label).toEqual('registration.receiveEmails'); - expect(checkboxWrapper.first().props().name).toEqual('subscribe'); - }); - test('handleValidSubmit passes formData to next step', () => { const formikBag = { setSubmitting: jest.fn()