Skip to content

Task solution#1545

Open
h-rostyslav wants to merge 3 commits into
mate-academy:masterfrom
h-rostyslav:develop
Open

Task solution#1545
h-rostyslav wants to merge 3 commits into
mate-academy:masterfrom
h-rostyslav:develop

Conversation

@h-rostyslav

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

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 prevent task completion. The task explicitly requires both success and error handlers for both promises, but promise1 is missing an error handler and promise2 is missing a success handler — each promise currently only has one handler attached. Additionally, there's a typo on line 15: 'Promises was rejected!' should be 'Promise was rejected!' (singular). The Cypress tests are failing because the error message never appears, confirming the handlers aren't properly chained. To fix this, chain both handlers on each promise using either .then(showSuccess).catch(showError) or .then(showSuccess, showError) syntax. Once both handlers are attached to both promises and the typo is corrected, your code should pass the tests.


✨ 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/scripts/main.js Outdated
}, 3000);
});

promise1.then(showSuccess);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing error handler for promise1. The task requires adding BOTH success and error handlers to both promises. Use .catch(showError) or .then(showSuccess, showError).

Comment thread src/scripts/main.js Outdated
});

promise1.then(showSuccess);
promise2.catch(showError);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing success handler for promise2. The task requires adding BOTH success and error handlers to both promises. Use .then(showSuccess) or .then(showSuccess, showError).

Comment thread src/scripts/main.js Outdated
const message = document.createElement('div');

message.classList.add('message', 'error-message');
message.textContent = 'Promises was rejected!';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo: 'Promises was rejected!' should be 'Promise was rejected!' (singular) to match the task requirement exactly.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

All task requirements are met and previous issues have been resolved. Both promise1 and promise2 now have both success and error handlers properly chained using .then(showSuccess).catch(showError), and the error message typo has been corrected to the singular form 'Promise was rejected!'. The implementation is clean and functional.


✨ 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