Skip to content

Add solution#168

Open
dminikulin wants to merge 2 commits intomate-academy:mainfrom
dminikulin:develop
Open

Add solution#168
dminikulin wants to merge 2 commits intomate-academy:mainfrom
dminikulin:develop

Conversation

@dminikulin
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Verify that checkPassword('Str@ng') returns false, as this is a specific example given in the requirements.
  2. 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

});

// write more tests here

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

});

// write more tests here
it(`should works with password having non-latin characters`, () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants