Skip to content

git add solution#4240

Open
andriy-stetsula wants to merge 2 commits into
mate-academy:masterfrom
andriy-stetsula:develop
Open

git add solution#4240
andriy-stetsula wants to merge 2 commits into
mate-academy:masterfrom
andriy-stetsula:develop

Conversation

@andriy-stetsula
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

Your implementation has critical issues that must be fixed. First, the app crashes because Sum.jsx is missing a default export — App.jsx imports it as a default import (import Sum from...) but Sum.jsx only has a named export, causing integration tests to fail entirely. Add export default Sum; at the bottom of Sum.jsx. Second, checklist violations: [CHECKLIST ITEM #1] App.jsx passes explicit a={0} and b={0} props when it shouldn't — for <Sum a={10} /> omit the b prop entirely, for <Sum b={5} /> omit the a prop, and for <Sum /> pass no props at all to test default prop handling. [CHECKLIST ITEM #2] Sum.jsx uses hardcoded JSX expressions ({a}, {b}, {a + b}) instead of the required template literal: {Sum of ${a} and ${b} is ${a + b}}. The core component logic passes unit tests, so fixing these issues should resolve everything.


✨ 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 thread src/App.jsx Outdated
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: The task requires 'just a = 10' (no b prop), but the code passes b={0} explicitly. Omit the b prop to test default prop handling.

Comment thread src/App.jsx Outdated
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: The task requires 'just b = 5' (no a prop), but the code passes a={0} explicitly. Omit the a prop to test default prop handling.

Comment thread src/App.jsx Outdated
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
<Sum a={0} b={0} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: The task requires 'no params at all', but the code passes both a={0} and b={0}. Pass no props to test default prop handling.

Comment thread src/App.jsx
import React from 'react';
import './App.scss';
import Sum from './components/Sum/Sum';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #2 violation: The checklist requires using string interpolation inside tag content. Use template literal syntax: {Sum of ${a} and ${b} is ${a + b}}

export const Sum = ({ a = 0, b = 0 }) => {
return (
<p>
Sum of {a} and {b} is {a + b}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #2 violation: Use template literal string interpolation inside tag content. Replace with {Sum of ${a} and ${b} is ${a + b}}

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

Your implementation correctly handles all functional requirements: the Sum component accepts a and b props with default values of 0, uses a named export, and App.jsx properly renders all five instances without passing unnecessary explicit zero props.

There is one remaining checklist item to address: checklist item #2 requires using template literal string interpolation for the output text. In src/components/Sum/Sum.jsx, change the JSX content to use a single template literal like:

<p>{`Sum of ${a} and ${b} is ${a + b}`}</p>

This is a straightforward syntax adjustment that doesn't affect the component's functionality. Once you make this change, you'll have fully met all the checklist requirements. Great work on the implementation!


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

Footnotes

  1. Rate AI review example

Comment thread src/App.jsx
import React from 'react';
import './App.scss';
import { Sum } from './components/Sum/Sum';

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 violates checklist item #2: Use template literal string interpolation instead of hardcoded JSX expressions. Change to: {Sum of ${a} and ${b} is ${a + b}}

export const Sum = ({ a = 0, b = 0 }) => {
return (
<p>
Sum of {a} and {b} is {a + b}
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 violates checklist item #2 which requires using string interpolation inside tag content. Replace with <p>{Sum of ${a} and ${b} is ${a + b}}</p>

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