Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/components/join-flow/email-step.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -100,8 +99,7 @@ class EmailStep extends React.Component {
return (
<Formik
initialValues={{
email: '',
subscribe: false
email: ''
}}
validate={this.validateForm}
validateOnBlur={false}
Expand Down Expand Up @@ -186,13 +184,6 @@ class EmailStep extends React.Component {
message={this.props.intl.formatMessage({id: 'registration.emailStepInfo'})}
/>
</div>
<div className="join-flow-email-checkbox-row">
<FormikCheckbox
id="subscribeCheckbox"
label={this.props.intl.formatMessage({id: 'registration.receiveEmails'})}
name="subscribe"
/>
</div>
<Captcha
ref={this.setCaptchaRef}
onCaptchaError={this.props.onCaptchaError}
Expand Down
1 change: 0 additions & 1 deletion src/components/join-flow/join-flow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class JoinFlow extends React.Component {
'g-recaptcha-response': formData['g-recaptcha-response'],
'gender': formData.gender,
'country': formData.country,
'subscribe': true,
'is_robot': formData.yesno
// no need to include csrfmiddlewaretoken; will be provided in
// X-CSRFToken header, which scratchr2 looks for in
Expand Down
3 changes: 1 addition & 2 deletions src/l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"registration.genderOptionAnother": "Another gender:",
"registration.genderOptionPreferNotToSay": "Prefer not to say",
"registration.emailStepTitle": "What's your email?",
"registration.emailStepInfo": "This will help if you forget your password, or if you want to receive email updates. This information will not be made public on your account.",
"registration.emailStepInfo": "This will help if you forget your password. This information will not be made public on your account.",
"registration.goToClass": "Go to Class",
"registration.invitedBy": "invited by",
"registration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account",
Expand All @@ -201,7 +201,6 @@
"registration.personalStepDescription": "Your individual responses will not be displayed publicly, and will be kept confidential and secure",
"registration.private": "We will keep this information private.",
"registration.problemsAre": "The problems are:",
"registration.receiveEmails": "I'd like to receive emails from the Scratch Team about project ideas, events, and more.",
"registration.selectCountry": "Select country",
"registration.startOverInstruction": "Click \"Start over.\"",
"registration.studentPersonalStepDescription": "This information will not appear on the Scratch website.",
Expand Down
19 changes: 0 additions & 19 deletions test/unit/components/email-step.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
const {mountWithIntl} = require('../../helpers/intl-helpers.jsx');
const JoinFlowStep = require('../../../src/components/join-flow/join-flow-step.jsx');
const FormikInput = require('../../../src/components/formik-forms/formik-input.jsx');
const FormikCheckbox = require('../../../src/components/formik-forms/formik-checkbox.jsx');

const requestSuccessResponse = {
requestSucceeded: true,
Expand Down Expand Up @@ -49,7 +48,6 @@ describe('EmailStep test', () => {
{...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);
Expand Down Expand Up @@ -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(<EmailStep
{...defaultProps()}
/>);

// 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()
Expand Down