Skip to content

impl#1550

Open
SnkvS wants to merge 1 commit into
mate-academy:masterfrom
SnkvS:impl
Open

impl#1550
SnkvS wants to merge 1 commit into
mate-academy:masterfrom
SnkvS:impl

Conversation

@SnkvS

@SnkvS SnkvS commented Jun 14, 2026

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

I am requesting changes because several explicit task requirements that tests will depend on are not yet met, so the current solution is functionally incomplete. The task requires two promises named promise1 and promise2, but in src/scripts/main.js they are currently named firstPromise and secondPromise, which will cause identifier-based tests to fail. Each of these promises must have both a success (.then) and an error (.catch) handler attached: right now firstPromise only has a success handler and secondPromise only has an error handler, so you need to add the missing handlers to each.

The handlers also need to set the text content explicitly, not via the resolved/rejected values: in all success handlers, create/append a <div class="message"> and set div.textContent = 'Promise was resolved!', and in all error handlers create/append a <div class="message error-message"> and set div.textContent = 'Promise was rejected!'. Currently, the success handler uses the resolved value and the error handler uses err.message, which does not follow the literal-text requirement and may fail strict tests. On the positive side, you correctly resolve the first promise on .logo click and reject the second after 3 seconds, and your DOM manipulation pattern is close to what’s needed. Once you rename the promises, add the missing handlers, and set the exact required strings in the handlers, your solution should align well with the specification.


✨ 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
'use strict';

// write your code here
const firstPromise = new Promise((resolve) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires the first promise to be named promise1, and it also needs both success and error handlers attached; consider renaming and adding a .catch handler for error cases.

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

const secondPromise = new Promise((resolve, reject) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires promise2 as the identifier and also needs a success handler in addition to the error handler; adjust the name and add a .then handler.

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

div.className = 'message';
div.textContent = value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to the requirements, the success handler itself should set div.textContent = 'Promise was resolved!' explicitly rather than relying on the resolved value.

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

div.className = 'message error-message';
div.textContent = err.message;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For the error handler, the requirements call for div.textContent = 'Promise was rejected!' explicitly, instead of using err.message.

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