Develop#3724
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The component has a critical test failure. The Person component is only rendering the raw name ('Misha') instead of the expected formatted output ('My name is Misha'). Both cypress/integration/page.spec.js and src/Person.spec.jsx are failing because of this. To fix this, update the Person component to display the name with the proper prefix. Instead of just {name}, use My name is {name} or the appropriate format based on the task requirements. There are also two code style violations to address: [CHECKLIST ITEM #2] the ternary operator in App.jsx should have each operand on its own line, and [CHECKLIST ITEM #3] the sex === 'm' ? 'wife' : 'husband' logic in Person.jsx should be extracted to a separate variable like const partnerLabel before the return statement.
✨ 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
| {age && <p className="Person__age">I am {age}</p>} | ||
| {isMarried ? ( | ||
| <p className="Person__partner"> | ||
| {partnerName} is my {sex === 'm' ? 'wife' : 'husband'} |
There was a problem hiding this comment.
This violates checklist item #3: 'Avoid putting several cases to conditional rendering. Create separate variable for the condition.' The sex === 'm' ? 'wife' : 'husband' logic is embedded directly in JSX. Extract this to a variable like const partnerLabel = sex === 'm' ? 'wife' : 'husband' before the return statement.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
All core functionality is working correctly—the Person component properly displays details, conditionally renders age and partner information, uses destructuring for props, and the critical name formatting issue is fixed. The only remaining issue is a formatting violation in CHECKLIST ITEM #2. In both src/components/Person/Person.jsx and src/App.jsx, the ternary operator operands should each be on a separate line for readability. For example, the code in Person.jsx line 5 should be reformatted to: jsx const second = sex === 'm' ? 'wife' : 'husband'; This is a minor style issue that doesn't affect functionality—your implementation passes all requirements. Keep up the good work on getting the logic right!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| export const Person = ({ person }) => { | ||
| const { name, age, sex, isMarried, partnerName } = person; | ||
|
|
||
| const second = sex === 'm' ? 'wife' : 'husband'; |
There was a problem hiding this comment.
CHECKLIST ITEM #2 VIOLATION: The ternary operator should have each operand on a separate line for readability. Format it as:
| import { Person } from './components/Person/Person'; | ||
| import './App.scss'; | ||
|
|
||
| export const misha = { |
There was a problem hiding this comment.
CHECKLIST ITEM #2 violation: Format ternary operator operands correctly - move each operand to the separate line. Current: const second = sex === 'm' ? 'wife' : 'husband'; Should be:
const second = sex === 'm'
? 'wife'
: 'husband';
No description provided.