Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(client): The Sync flow should not notify the browser of login aft…
Browse files Browse the repository at this point in the history
…er the signup confirmation poll completes.

The browser polls in the background for the status of the sign up completion itself, the client does not need to notify it of completion.

In addition, the /confirm screen should not transition to the /signup_complete screen, this causes a jerky UI.

fixes #1881
  • Loading branch information
Shane Tomlinson committed Nov 14, 2014
1 parent 07afa39 commit 3ba5372
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 90 deletions.
2 changes: 1 addition & 1 deletion app/scripts/models/auth_brokers/fx-desktop.js
Expand Up @@ -62,7 +62,7 @@ define([
},

afterSignUpConfirmationPoll: function () {
return this._notifyRelierOfLogin();
return p({ halt: true });
},

afterResetPasswordConfirmationPoll: function () {
Expand Down
10 changes: 3 additions & 7 deletions app/tests/spec/models/auth_brokers/fx-desktop.js
Expand Up @@ -138,14 +138,10 @@ define([
});

describe('afterSignUpConfirmationPoll', function () {
it('notifies the channel of login', function () {
sinon.stub(broker, '_notifyRelierOfLogin', function () {
return p();
});

it('halts', function () {
return broker.afterSignUpConfirmationPoll()
.then(function () {
assert.isTrue(broker._notifyRelierOfLogin.called);
.then(function (result) {
assert.isTrue(result.halt);
});
});
});
Expand Down
99 changes: 17 additions & 82 deletions tests/functional/sync_sign_up.js
Expand Up @@ -28,7 +28,6 @@ define([
var PASSWORD = '12345678';

var listenForFxaCommands = FxDesktopHelpers.listenForFxaCommands;
var testIsBrowserNotifiedOfLogin = FxDesktopHelpers.testIsBrowserNotifiedOfLogin;

registerSuite({
name: 'Firefox Desktop Sync sign_up',
Expand Down Expand Up @@ -59,28 +58,11 @@ define([
.findByCssSelector('#fxa-signup-header')
.end()

.findByCssSelector('form input.email')
.click()
.type(email)
.end()

.findByCssSelector('form input.password')
.click()
.type(PASSWORD)
.end()

.findByCssSelector('#fxa-age-year')
.click()
.end()

.findById('fxa-' + (TOO_YOUNG_YEAR - 1))
.pressMouseButton()
.releaseMouseButton()
.click()
.end()
.then(function () {
return FunctionalHelpers.fillOutSignUp(self, email, PASSWORD, TOO_YOUNG_YEAR - 1);
})

.findByCssSelector('button[type="submit"]')
.click()
.findByCssSelector('#fxa-confirm-header')
.end()

// verify the user
Expand All @@ -105,16 +87,13 @@ define([

.end()
.closeCurrentWindow()
// switch to the original window
.switchToWindow('')
.end()

.findByCssSelector('#fxa-sign-up-complete-header')
// switch to the original window, it should not transition.
.switchToWindow('')
.end()

.then(function () {
return testIsBrowserNotifiedOfLogin(self);
});
.findByCssSelector('#fxa-confirm-header')
.end();
},

'signup, verify different browser - from original tab\'s P.O.V.': function () {
Expand All @@ -128,30 +107,9 @@ define([
.findByCssSelector('#fxa-signup-header')
.end()

.findByCssSelector('form input.email')
.clearValue()
.click()
.type(email)
.end()

.findByCssSelector('form input.password')
.click()
.type(PASSWORD)
.end()

.findByCssSelector('#fxa-age-year')
.click()
.end()

.findById('fxa-' + (TOO_YOUNG_YEAR - 1))
.pressMouseButton()
.releaseMouseButton()
.click()
.end()

.findByCssSelector('button[type="submit"]')
.click()
.end()
.then(function () {
return FunctionalHelpers.fillOutSignUp(self, email, PASSWORD, TOO_YOUNG_YEAR - 1);
})

.findByCssSelector('#fxa-confirm-header')
.end()
Expand All @@ -160,12 +118,9 @@ define([
return FunctionalHelpers.openVerificationLinkDifferentBrowser(client, email);
})

.findByCssSelector('#fxa-sign-up-complete-header')
.end()

.then(function () {
return testIsBrowserNotifiedOfLogin(self);
});
// The original tab should not transition
.findByCssSelector('#fxa-confirm-header')
.end();
},

'signup, verify different browser - from new browser\'s P.O.V.': function () {
Expand All @@ -179,29 +134,9 @@ define([
.findByCssSelector('#fxa-signup-header')
.end()

.findByCssSelector('form input.email')
.click()
.type(email)
.end()

.findByCssSelector('form input.password')
.click()
.type(PASSWORD)
.end()

.findByCssSelector('#fxa-age-year')
.click()
.end()

.findById('fxa-' + (TOO_YOUNG_YEAR - 1))
.pressMouseButton()
.releaseMouseButton()
.click()
.end()

.findByCssSelector('button[type="submit"]')
.click()
.end()
.then(function () {
return FunctionalHelpers.fillOutSignUp(self, email, PASSWORD, TOO_YOUNG_YEAR - 1);
})

// clear local/sessionStorage to synthesize continuing in
// a separate browser.
Expand Down

0 comments on commit 3ba5372

Please sign in to comment.