Skip to content
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

Alteração em JSX #2646

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tecnicorikardo
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.

Great job on implementing the Person component and its tests! 🎉 The component meets the task requirements, and the tests are well-structured. While there are minor improvements suggested, such as checking for partnerName and enhancing the test case for age, these do not impact the core functionality. Keep up the good work and consider these suggestions for future enhancements! 😊

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

Comment on lines +10 to +12
{person.isMarried
? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}`
: 'I am not married'}

Choose a reason for hiding this comment

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

Consider adding a check to ensure person.partnerName is defined before using it. This will prevent potential errors if partnerName is undefined. You can use a conditional check similar to how person.age is handled.

Comment on lines 54 to 61
it('should not show age if age is omitted', () => {
const sasha = {
name: 'Sasha',
sex: 'f',
isMarried: false,
};

mount(<Person person={sasha} />);

cy.get('.Person__age').should('not.exist');

Choose a reason for hiding this comment

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

The test case checks that the .Person__age element does not exist when age is omitted, which is correct. However, it might be beneficial to also check that the greeting message displays 'unknown' for the age in this scenario, as per the component's implementation.

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