Skip to content

add task solution - #2105

Draft
Arturchukk wants to merge 6 commits into
mate-academy:masterfrom
Arturchukk:develop
Draft

Arturchukk wants to merge 6 commits into
mate-academy:masterfrom
Arturchukk:develop

Conversation

@Arturchukk

Copy link
Copy Markdown

@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 solution has two critical issues that need fixing:

  1. Test Failure - Sorting Not Working: The Cypress test should be sorted by salary DSC is failing with expected 5 to equal 10. This means your sorting logic isn't correctly sorting by salary in descending order. The test expects the highest salary (10) to appear first, but it's getting 5 instead. Check your sorting implementation in sortList function.

  2. Missing Required Helper Function: The task description explicitly states "Salary from data attribute is a string, do not forget to convert it to number, write helper function for it." You need to create a dedicated helper function (like parseSalary(salaryString)) to convert salary strings to numbers, rather than using Number() inline in both functions. This is both a requirement violation and would eliminate code duplication.

The sorting issue appears to be the primary blocker - please verify your sorting logic uses b.salary - a.salary for descending order and that it's properly updating the DOM after sorting.


✨ 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
Comment on lines +7 to +14
function sortList(employeesList) {
const array = Array.from(employeesList.querySelectorAll('li'));

array.sort(function (a, b) {
return Number(b.dataset.salary) - Number(a.dataset.salary);
});

list.append(...array);

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 description requires creating a helper function to convert salary string to number ('write helper function for it'), but the code uses Number() inline in both functions instead. Consider extracting this into a separate helper function as specified in the requirements.

Comment thread src/scripts/main.js
for (const l of li) {
const employee = {
name: l.dataset.name,
position: l.dataset.position,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same issue - using inline Number() instead of a helper function for salary conversion.

@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

The implementation is close, but the required descending salary sort is still failing a functional test: Cypress reports that should be sorted by salary DSC expected 10 but received 5 (cypress/integration/jsTaskParseListDOM.spec.js:29). Please check the sortList behavior when the sort control is used and ensure it compares salary values numerically in descending order, then appends the items in that order. The available review does not include source line numbers for main.js, so I can’t point to a precise line there. The employee extraction and other reviewed requirements appear to be addressed; fixing this sorting failure should unblock approval.


✨ 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 ↩

@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 approving this as an educational override to help you progress while learning, although the Cypress check reports a sorting failure. In cypress/integration/jsTaskParseListDOM.spec.js:29, the test expected salary 10 first but observed 5, so the rendered list is not in descending salary order; review the comparator to ensure it compares salaries numerically from highest to lowest and that the sorted list is the one rendered. The employee parsing and extraction requirements are otherwise reported as satisfied, and linting and the item-count test pass. Keep building on that solid work by addressing the sort discrepancy.


✨ 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 ↩

@Arturchukk
Arturchukk marked this pull request as draft November 11, 2026 23:50
@Arturchukk
Arturchukk marked this pull request as ready for review November 11, 2026 23:52
@Arturchukk
Arturchukk marked this pull request as draft November 11, 2026 23:54

This branch has not been deployed

No deployments
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.

3 participants