Skip to content
This repository has been archived by the owner. It is now read-only.

feat(mailcheck): enabling mailcheck for all. #4703

Closed
wants to merge 1 commit into from

Conversation

@divyabiyani
Copy link
Member

@divyabiyani divyabiyani commented Feb 7, 2017

No description provided.

@divyabiyani divyabiyani force-pushed the divyabiyani:mailcheck branch 2 times, most recently from 314a593 to 6a98c04 Feb 7, 2017
'intern!object',
'tests/functional/lib/helpers'
], function (intern, registerSuite, FunctionalHelpers) {
var EXP_MAILCHECK_URL = intern.config.fxaContentRoot + 'signup?forceExperiment=mailcheck&automatedBrowser=true';

This comment has been minimized.

@vladikoff

vladikoff Feb 7, 2017
Contributor

@divyabiyani for this file, we should keep it, but rename it to mailcheck (make sure to rename it in the list of functional tests as well).

We can remove the 'signup?forceExperiment=mailcheck&automatedBrowser=true' query part and only leave the 'treatment works': function () { test. Delete the 'control works': function () { test though

if (e.type === 'click' || e.which === KeyCodes.ENTER) {
element.val(suggestion.full);
// the user has used the suggestion
view.notifier.trigger('mailcheck.clicked');

This comment has been minimized.

@vladikoff

vladikoff Feb 7, 2017
Contributor

@divyabiyani this used to log that the tooltip was clicked into the experiment file. Could you change this to logEvent, this way we still get metrics that users click on the tooltip.

We might have a unit test for the mailcheck click action, we need to update it to make sure that the correct event is logged

@@ -55,37 +55,34 @@ define(function (require, exports, module) {

// user got a suggestion to check their email input
view.notifier.trigger('mailcheck.suggested');

This comment has been minimized.

@vladikoff

vladikoff Feb 7, 2017
Contributor

same as https://github.com/mozilla/fxa-content-server/pull/4703/files#r99847017 , except this should logEvent that mailcheck was suggested

if (e.type === 'click' || e.which === KeyCodes.ENTER) {
element.val(suggestion.full);
// the user has used the suggestion
view.notifier.trigger('mailcheck.clicked');
@divyabiyani divyabiyani force-pushed the divyabiyani:mailcheck branch 7 times, most recently from d664fff to cf001d3 Feb 9, 2017
@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 9, 2017

Need to change the tests:

describe('suggestEmail', function () {

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 9, 2017

To fix issue with lib/experiment: either use the connectAnotherDevice for the test OR pass in allExperiments optionally for the test

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 9, 2017

See if we can fix corrected event here: https://github.com/mozilla/fxa-content-server/blob/master/app/scripts/views/sign_up.js#L215 Also double if any other component uses signup.submit trigger, can we safely remove it?

@divyabiyani divyabiyani force-pushed the divyabiyani:mailcheck branch 4 times, most recently from 115ab9d to 3afa544 Feb 13, 2017
@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 15, 2017

tests/spec/views/sign_up

check for isInExperiment for mailcheck, we can remove some of that

sinon.stub(view, 'isInExperiment', () => true);
(we still need that test, but without the experiment code)

The fail in does not show when able chooses control -> that whole test can be removed.
it('accepts window parameter override' can also be removed.
it('works when able chooses treatment' can also be removed.

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 15, 2017

it('accepts window parameter override' test can be removed, we no longer use the parameter override.

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 15, 2017

image

^ make that red, using an option to the Tooltip constructor. Maybe call the option, try isError: true. We might use that in other tooltips in the future.

@@ -34,22 +31,12 @@ define([
var CORRECTED_EMAIL = 'something@gmail.com';

This comment has been minimized.

@vladikoff

vladikoff Feb 15, 2017
Contributor

rename this from 'treatment works' - tooltip works

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 15, 2017

tests/functional.js -> needs a rename from './functional/verification_experiments', to mailcheck

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 15, 2017

functional tests

seeing issues with the password click, try using the following:

        .then(type('.email', BAD_EMAIL))
        .then(click('#fxa-signup-header'))
        .then(click('.tooltip-suggest > span:nth-child(1)'))
@divyabiyani divyabiyani force-pushed the divyabiyani:mailcheck branch 5 times, most recently from a543feb to 3c4db31 Feb 20, 2017

if (emailValue.length > 0 && mailcheckValue === emailValue) {
this.logEvent('mailcheck.corrected');
}

This comment has been minimized.

@vladikoff

vladikoff Feb 21, 2017
Contributor

@divyabiyani can we extract this logic into its own function?

This comment has been minimized.

@vladikoff

vladikoff Feb 21, 2017
Contributor

call it _checkMailcheckResult maybe ?

}
};
notifier.trigger('signup.submit', {}, mockView);
assert.isTrue(TestHelpers.isEventLogged(metrics, 'experiment.treatment.mailcheck.corrected'));

This comment has been minimized.

@vladikoff

vladikoff Feb 21, 2017
Contributor

@divyabiyani related to https://github.com/mozilla/fxa-content-server/pull/4703/files#r102228528 let's make sure we have a unit test that checks that corrected has been logged. You can add this by unit testing the new "corrected" function (see linked comment).

This comment has been minimized.

@vladikoff

vladikoff Feb 21, 2017
Contributor

@divyabiyani ok perfect, then we can just clean up the code in (so it lives in its own function ) #4703 (comment) and it will already be tested 👍

.then(type('.email', BAD_EMAIL))
.then(click('.password'))
.then(click('#age'))

This comment has been minimized.

@vladikoff

vladikoff Feb 21, 2017
Contributor

@divyabiyani can you check if adding a .sleep(1000) helps this, maybe there is an issue with tooltip fade on CI, example:

       .then(openPage(EXP_MAILCHECK_URL, '#fxa-signup-header'))
        .then(type('.email', BAD_EMAIL))
        .then(click('#age'))
        // give time for the tooltip to fade in
        .sleep(1000)
        .then(click('.tooltip-suggest > span:nth-child(1)'))
@divyabiyani divyabiyani force-pushed the divyabiyani:mailcheck branch 2 times, most recently from 98fbf4d to 556da64 Feb 21, 2017
@rfk rfk added this to the FxA-79: mailcheck pt2 milestone Feb 21, 2017
@vladikoff vladikoff changed the title [WIP]: Enabling mailcheck for all. feat(mailcheck): enabling mailcheck for all. Feb 22, 2017
@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Feb 23, 2017

Continued in #4751

@vladikoff vladikoff closed this Feb 23, 2017
@divyabiyani divyabiyani deleted the divyabiyani:mailcheck branch Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants