Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great start on the tests for checkPassword! You've covered most of the validation rules well. However, I'm requesting a couple of changes to ensure all requirements are met. Your test suite is missing two key scenarios from the task description.
Please add tests for the following cases:
- Verify that
checkPassword('Str@ng')returnsfalse, as this is a specific example given in the requirements. - Verify that a password with non-Latin characters (e.g.,
'пароль1!') is considered invalid.
Once you add these two tests, your solution will fully cover the requirements. You're almost there!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| }); | ||
|
|
||
| // write more tests here | ||
|
|
There was a problem hiding this comment.
The task requirements include the example checkPassword('Str@ng') === false. Please add a specific test case to cover this.
| it(`should return 'false' for the password | ||
| if it lacks at least 1 special character`, () => { | ||
| expect(checkPassword('StrongP2ssword')).toBe(false); | ||
| }); |
There was a problem hiding this comment.
The rules state that the password 'accepts only letters of the Latin alphabet Aa-Zz'. You should add a test case to verify that a password with non-Latin characters is considered invalid.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this update! I am approving your solution as you've successfully added all the required tests, and the test suite is now comprehensive. I have one small suggestion for future improvement in src/checkPassword.test.js. The test description should works with password having non-latin characters could be clearer, since the test correctly expects a false result. A more descriptive name like should return 'false' for a password with non-latin characters would better reflect its purpose. This is just a minor point for clarity. Great job overall!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| }); | ||
|
|
||
| // write more tests here | ||
| it(`should works with password having non-latin characters`, () => { |
There was a problem hiding this comment.
This test description is a little misleading. "should works with" usually implies a successful outcome, but the test correctly asserts that the function should return false. A clearer description would be something like should return 'false' for a password with non-latin characters.
No description provided.