-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
base: master
Are you sure you want to change the base?
Alteração em JSX #2646
Conversation
There was a problem hiding this 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! ✨
{person.isMarried | ||
? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` | ||
: 'I am not married'} |
There was a problem hiding this comment.
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.
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'); |
There was a problem hiding this comment.
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.
No description provided.