diff --git a/test/remote/account_unlock_tests.js b/test/remote/account_unlock_tests.js index da4aa58e2..8137d5c1e 100644 --- a/test/remote/account_unlock_tests.js +++ b/test/remote/account_unlock_tests.js @@ -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) } ) @@ -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) } ) @@ -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) } ) @@ -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) } ) diff --git a/test/remote/password_forgot_tests.js b/test/remote/password_forgot_tests.js index f3d5b3083..75027b34c 100644 --- a/test/remote/password_forgot_tests.js +++ b/test/remote/password_forgot_tests.js @@ -31,6 +31,11 @@ TestServer.start(config) .then( function (x) { client = x + return server.mailbox.waitForEmail(email) + } + ) + .then( + function () { return client.keys() } ) @@ -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() @@ -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') - } - ) } )