temp: add redesign launch experiment and events (#358)

This commit is contained in:
Waheed Ahmed
2021-06-17 17:02:50 +05:00
parent e59f11a96e
commit cda8f49723
6 changed files with 19 additions and 25 deletions

View File

@@ -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 (

View File

@@ -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"

View File

@@ -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} />));

View File

@@ -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 (

View File

@@ -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"

View File

@@ -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', () => {