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

Commit

Permalink
fix(tests): Build and test fixes for latest fxa-auth-mailer update.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk authored and vbudhram committed Apr 12, 2016
1 parent d7638a6 commit 493f917
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
24 changes: 24 additions & 0 deletions test/remote/account_unlock_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ TestServer.start(config)
.then(
function (c) {
client = c
// clear the new-login notification email
return server.mailbox.waitForEmail(email)
}
)
.then(
function () {
return client.lockAccount(email, password)
}
)
Expand Down Expand Up @@ -144,6 +150,12 @@ TestServer.start(config)
.then(
function (c) {
client = c
// clear the new-login notification email
return server.mailbox.waitForEmail(email)
}
)
.then(
function () {
return client.lockAccount(email, password)
}
)
Expand Down Expand Up @@ -188,6 +200,12 @@ TestServer.start(config)
.then(
function (c) {
client = c
// clear the new-login notification email
return server.mailbox.waitForEmail(email)
}
)
.then(
function () {
return client.lockAccount(email, password)
}
)
Expand Down Expand Up @@ -235,6 +253,12 @@ TestServer.start(config)
.then(
function (c) {
client = c
// clear the new-login notification email
return server.mailbox.waitForEmail(email)
}
)
.then(
function () {
return client.lockAccount(email, password)
}
)
Expand Down
37 changes: 19 additions & 18 deletions test/remote/password_forgot_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ TestServer.start(config)
.then(
function (x) {
client = x
return server.mailbox.waitForEmail(email)
}
)
.then(
function () {
return client.keys()
}
)
Expand All @@ -52,6 +57,18 @@ TestServer.start(config)
return resetPassword(client, code, newPassword)
}
)
.then(
function () {
return server.mailbox.waitForEmail(email)
}
)
.then(
function (emailData) {
var link = emailData.headers['x-link']
var query = url.parse(link, true).query
t.ok(query.email, 'email is in the link')
}
)
.then(
function () {
return client.keys()
Expand All @@ -71,27 +88,11 @@ TestServer.start(config)
}
)
.then(
function (x) {
client = x
return client.keys()
}
)
.then(
function (keys) {
t.ok(Buffer.isBuffer(keys.kA), 'kA exists, login after password reset')
t.ok(Buffer.isBuffer(keys.wrapKb), 'wrapKb exists, login after password reset')
t.equal(client.kB.length, 32, 'kB exists, has the right length')

function () {
// clear new-login notification email
return server.mailbox.waitForEmail(email)
}
)
.then(
function (emailData) {
var link = emailData.headers['x-link']
var query = url.parse(link, true).query
t.ok(query.email, 'email is in the link')
}
)
}
)

Expand Down

0 comments on commit 493f917

Please sign in to comment.