First promises#1558
Conversation
balakhmei
commented
Jun 27, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because all core functional requirements from the task are correctly implemented. You declare both promise1 and promise2 in src/scripts/main.js, resolve promise1 on the .logo click event, and reject promise2 via setTimeout after 3000 ms, matching the specification. Both promises have .then and .catch handlers, and these handlers append the required <div class="message"> and <div class="message error-message"> elements with the appropriate text to the body, which aligns with the Cypress tests. There are no critical blockers or broken functionality evident in the code, so the implementation should pass the automated tests for the described behavior.
As minor, non-blocking suggestions, you could consider extracting shared logic for creating and appending message elements so promise1 and promise2 reuse the same helper functions, which would reduce duplication. Also, note that promise1 never actually rejects, so the .catch there is mostly illustrative; if you keep it, you might document that it’s not expected to run. Finally, please double-check that your demo link in the README or PR description includes your GitHub username as required, and that you’ve run the specified npm test commands locally to fully satisfy the process checklist. Overall, nice job implementing the promises and wiring them up cleanly to the DOM and tests.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨