-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: improve coverage #156
Conversation
Closing this PR due to no activity. Feel free to reopen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional tests and cleanup!
} | ||
|
||
if (!newPassword) { | ||
return callback(new Error('Password may not be empty')); | ||
} | ||
|
||
call( | ||
'changePassword', | ||
oldPassword ? hashPassword(oldPassword) : null, | ||
hashPassword(newPassword), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really hashed here? Had a look at Meteors password_server.js
, looks like the newPassword is hashed on the server side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it, it sending the object with the sha256 hash, not the string.
@@ -90,8 +98,16 @@ class AccountsPassword { | |||
* @param callback {function(e:Error)=} optional callback that is invoked with one optional error argument | |||
*/ | |||
resetPassword = (token, newPassword, callback = () => {}) => { | |||
if (!(typeof token === 'string' || token instanceof String)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the type checking different from e.g the createUser
function here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General question on the restoreAll
function; can't we simply do sinon.restore()
here?
Closing this PR due to no activity. Feel free to reopen. |
Summary
in order to make big changes/improvements/fixes without regression we need better test coverage ☔
By writing the tests there were mutliple issues that have been detected and commented accordingly, they are attempted to be non-breaking. Please consider once you review the PR.
Also note this PR is draft-mode until we reach >= 90% coverage!
Linked issue(s)
#152
Involved parts of the project
all
Added tests?
a lot
Targeted Meteor release version
2.x yet
Reproduction
run tests