Skip to content

test: add tests#160

Open
mykhailokurochkin wants to merge 3 commits intomate-academy:mainfrom
mykhailokurochkin:develop
Open

test: add tests#160
mykhailokurochkin wants to merge 3 commits intomate-academy:mainfrom
mykhailokurochkin:develop

Conversation

@mykhailokurochkin
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

Changes are needed for this submission. You've built a solid foundation by testing the examples from the task description, which is a great start! However, the test suite is incomplete because it doesn't check each validation rule on its own. To ensure full coverage, please add specific tests for these cases:

  • A password that is too short (fewer than 8 characters).
  • A password that is too long (more than 16 characters).
  • A password missing a digit.
  • A password missing an uppercase letter.
  • A password missing a special character.

Adding these will make your test suite comprehensive and ensure the function is fully validated.


✨ 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

Comment on lines 14 to +24
it(`should return 'true' for the valid password with 8 characters`, () => {
expect(checkPassword('Password1!')).toBe(true);
});

it('returns false for too-short, lowercase-only password', () => {
expect(checkPassword('qwerty')).toBe(false);
});

// write more tests here
it(`should return false for short mixed-case password with symbol`, () => {
expect(checkPassword('Str@ng')).toBe(false);
});

Choose a reason for hiding this comment

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

These tests cover the provided examples well, but the test suite is incomplete. Consider adding more tests to check each validation rule individually. For instance, you should test passwords that are too long, or passwords that meet the length requirement but are missing a digit, an uppercase letter, or a special character.

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 addressing the previous feedback! Your test suite is much more robust now with specific tests for each validation rule. However, there's one final requirement that needs to be covered before this can be approved. The tests don't currently check if the password rejects invalid characters, such as non-Latin letters or emojis. Please add a test case with a password containing invalid characters (e.g., 'пароль1!' or 'Password1!🚀') and assert that checkPassword returns false. Adding this one last test will make your solution complete!


✨ 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

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 submission! You've successfully addressed the previous feedback by adding a test case for invalid characters. Your test suite is now complete and thoroughly covers all the password validation rules outlined in the requirements. The tests are well-written and logical. This is a great submission, and I am happy to approve it.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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