temp: add redesign launch experiment and events (#358)
This commit is contained in:
@@ -175,6 +175,13 @@ class LoginPage extends React.Component {
|
||||
|
||||
if (this.props.loginResult.success) {
|
||||
setSurveyCookie('login');
|
||||
|
||||
// Fire optimizely events
|
||||
window.optimizely = window.optimizely || [];
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: 'authn-login-coversion',
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -446,12 +446,12 @@ class RegistrationPage extends React.Component {
|
||||
|
||||
if (this.props.registrationResult.success) {
|
||||
setSurveyCookie('register');
|
||||
window.optimizely = window.optimizely || [];
|
||||
|
||||
// Fire optimizely events
|
||||
window.optimizely = window.optimizely || [];
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: 'van_504_total_registrations',
|
||||
eventName: 'authn-register-conversion',
|
||||
});
|
||||
|
||||
if (this.state.optimizelyExperimentName !== 'progressiveProfilingConcept1') {
|
||||
@@ -610,7 +610,7 @@ class RegistrationPage extends React.Component {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{getConfig().REGISTRATION_OPTIONAL_FIELDS && this.state.optimizelyExperimentName !== 'progressiveProfilingConcept1' ? (
|
||||
{getConfig().REGISTRATION_OPTIONAL_FIELDS && localStorage.getItem('DESIGN_NAME') !== 'redesign' ? (
|
||||
<AuthnValidationFormGroup
|
||||
label={intl.formatMessage(messages['support.education.research'])}
|
||||
for="optional"
|
||||
|
||||
@@ -126,16 +126,6 @@ describe('RegistrationPageTests', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should not show optional field check when optimizely experiment is set', () => {
|
||||
window.optimizelyExperimentName = 'progressiveProfilingConcept1';
|
||||
|
||||
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
|
||||
expect(registrationPage.find('RegistrationPage').state('optimizelyExperimentName')).toEqual('progressiveProfilingConcept1');
|
||||
expect(registrationPage.find('#optional').length).toEqual(0);
|
||||
|
||||
delete window.optimizelyExperimentName;
|
||||
});
|
||||
|
||||
it('should toggle optional fields state on checkbox click', () => {
|
||||
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
|
||||
|
||||
|
||||
@@ -190,6 +190,13 @@ class LoginPage extends React.Component {
|
||||
|
||||
if (this.props.loginResult.success) {
|
||||
setSurveyCookie('login');
|
||||
|
||||
// Fire optimizely events
|
||||
window.optimizely = window.optimizely || [];
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: 'authn-login-coversion',
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -494,7 +494,7 @@ class RegistrationPage extends React.Component {
|
||||
// Fire optimizely events
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: 'VAN-504-user-registered',
|
||||
eventName: 'authn-register-conversion',
|
||||
});
|
||||
|
||||
if (window.optimizelyExperimentName !== 'VAN-504-PP-Exp') {
|
||||
@@ -626,7 +626,7 @@ class RegistrationPage extends React.Component {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{getConfig().REGISTRATION_OPTIONAL_FIELDS && this.state.optimizelyExperimentName !== 'progressive_profiling_phase1' ? (
|
||||
{getConfig().REGISTRATION_OPTIONAL_FIELDS && localStorage.getItem('DESIGN_NAME') !== 'redesign' ? (
|
||||
<Form.Group className="mb-0 mt-2 small">
|
||||
<Form.Check
|
||||
id="optional-field-checkbox"
|
||||
|
||||
@@ -660,16 +660,6 @@ describe('RegistrationPage', () => {
|
||||
expect(analytics.sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'register');
|
||||
});
|
||||
|
||||
it('should not show optional field check when optimizely experiment is set', () => {
|
||||
window.optimizelyExperimentName = 'progressive_profiling_phase1';
|
||||
|
||||
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
|
||||
expect(registrationPage.find('RegistrationPage').state('optimizelyExperimentName')).toEqual('progressive_profiling_phase1');
|
||||
expect(registrationPage.find('#optional').length).toEqual(0);
|
||||
|
||||
delete window.optimizelyExperimentName;
|
||||
});
|
||||
|
||||
// ******** shouldComponentUpdate tests ********
|
||||
|
||||
it('should populate form with pipeline user details', () => {
|
||||
|
||||
Reference in New Issue
Block a user