Skip to content

qa_restore-names:master#349

Open
sonik-boom71 wants to merge 2 commits into
mate-academy:masterfrom
sonik-boom71:master
Open

qa_restore-names:master#349
sonik-boom71 wants to merge 2 commits into
mate-academy:masterfrom
sonik-boom71:master

Conversation

@sonik-boom71

Copy link
Copy Markdown

Написаны 8 unit-тестов в src/restoreNames.test.js, покрывающих:
пустой массив
пользователь с уже заданным firstName (не изменяется)
пользователь без firstName — восстанавливается из fullName
пользователь с пустым firstName ('') — тоже восстанавливается
fullName из нескольких слов — берётся только первое
fullName из одного слова
массив из нескольких пользователей без firstName
смешанный массив (с и без firstName)

@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 test file fully satisfies all task requirements. The tests properly cover the restoreNames function with 8 test cases including edge cases like empty arrays, existing firstName values, undefined firstName, extracting the first word from fullName, and handling multiple users. The tests correctly verify that the function mutates the input array in place rather than returning a new array. All requirements from the task description are implemented correctly using Jest's describe/it/expect syntax with appropriate matchers. No critical issues were found.


✨ 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