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

Commit

Permalink
fix(test): Fix and enable the oauth-preverified-sign-up functional test.
Browse files Browse the repository at this point in the history
fixes #1676
  • Loading branch information
Shane Tomlinson committed Sep 19, 2014
1 parent 42dab7b commit 7cade58
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 44 deletions.
77 changes: 37 additions & 40 deletions tests/functional/oauth_preverified_sign_up.js
Expand Up @@ -49,46 +49,43 @@ define([
'preverified sign up': function () {
var self = this;

return TestHelpers.getEmailPreverifyToken(email)
.then(function (token) {
var SIGNUP_URL = OAUTH_APP + 'api/preverified-signup?' +
'email=' + encodeURIComponent(email);

return self.get('remote')
.get(require.toUrl(SIGNUP_URL))
.setFindTimeout(intern.config.pageLoadTimeout)

.findByCssSelector('#fxa-signup-header')
.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()

// user is pre-verified and sent directly to the RP.
.findByCssSelector('#loggedin')
.getVisibleText()
.then(function (text) {
// user is signed in as pre-verified email
assert.equal(text, email);
})
.end();
});
var SIGNUP_URL = OAUTH_APP + 'api/preverified-signup?' +
'email=' + encodeURIComponent(email);

return self.get('remote')
.get(require.toUrl(SIGNUP_URL))
.setFindTimeout(intern.config.pageLoadTimeout)

.findByCssSelector('#fxa-signup-header')
.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()

// user is pre-verified and sent directly to the RP.
.findByCssSelector('#loggedin')
.getVisibleText()
.then(function (text) {
// user is signed in as pre-verified email
assert.equal(text, email);
})
.end();
}
});

Expand Down
6 changes: 2 additions & 4 deletions tests/functional_oauth.js
Expand Up @@ -6,10 +6,8 @@ define([
'./functional/oauth_sign_in',
'./functional/oauth_sign_up',
'./functional/oauth_reset_password',
'./functional/oauth_webchannel'/*,
TODO - enable this whenever 123done and the oauth-server are patched to handle
preverified emails.
'./functional/oauth_preverified_sign_up'*/
'./functional/oauth_webchannel',
'./functional/oauth_preverified_sign_up'
], function () {
'use strict';
});

0 comments on commit 7cade58

Please sign in to comment.