Skip to content

test: add tests for validateEmail function#168

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

test: add tests for validateEmail function#168
mykhailokurochkin wants to merge 2 commits intomate-academy:mainfrom
mykhailokurochkin:develop

Conversation

@mykhailokurochkin
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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

This requires a few changes before it can be approved. While you've set up a good foundation for the test suite, it's currently missing several critical test cases that are required by the task description. Specifically, you need to add tests for all the examples provided: 'test@mail.com', 't@q.c', and 'false@email'. Remember that the test for 'false@email' should assert that the function returns false, as the domain part must contain a dot. Additionally, please expand your tests to cover other rules, such as a dot not being allowed immediately before the @ (e.g., 'test.@domain.com') or at the start of the domain (e.g., 'test@.domain.com'). Adding these cases will ensure your test suite is comprehensive and meets all requirements.


✨ 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

it(`should return 'false' for emails without '@'`, () => {
expect(validateEmail('test838gmail.com')).toBe(false);
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test suite is missing several required cases. You should add tests for all the examples from the description (like 'test@mail.com', 't@q.c', and 'false@email'). Also, consider adding tests for other rules, such as a dot not being allowed immediately before the @ or at the start of the domain.

Copy link
Copy Markdown

@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 updating the test suite for validateEmail! You've successfully addressed all the previous feedback, and the tests are now comprehensive and well-structured. The test coverage fully meets all the requirements from the task description, including all specific examples and validation rules. I am happy to approve your solution. Keep up the great work!


✨ 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