Add unit tests for personUtils.ts
Description: frontend/src/utils/personUtils.ts has no test coverage, while other utilities in src/utils/ have tests in tests/.
Proposal: Add src/utils/tests/personUtils.test.ts covering:
- getPersonName: name vs. ID fallback, including empty string
- getPhotoCountText: singular/plural for photos and videos
- formatPeopleTitle: empty, one, two and three or more names in both match modes
- facePhotoToImage: default fields and null handling
Notes: No changes to existing source files. I already have a working implementation (21 tests passing, along with lint, type-check and the full suite) I would like to work on this.
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
Link your account with Gitcord
Thanks for opening this issue, @mystic-fae!
To receive Discord notifications and contributor tracking for this organization:
- Join Discord: https://discord.gg/hjUhu33uAn
- In Discord, run
/link mystic-fae - Paste the verification code into your GitHub bio (or a public gist)
- Click Verify in Discord (or run
/verify-link mystic-fae)
Once linked, Gitcord can notify you about assignments, mentions, and more.
— Posted by Gitcord
@rohan-pandeyy can you assign me this issue?
Hello,
I would like to work on this issue and contribute test coverage for frontend/src/utils/personUtils.ts.
I plan to add frontend/src/utils/__tests__/personUtils.test.ts to cover the utility functions comprehensively, including:
- getPersonName: Test name and ID fallback behavior, including empty strings.
- getPhotoCountText: Verify singular and plural formatting for photos and videos.
- formatPeopleTitle: Cover empty, one, two, and three-or-more names in both match modes.
- facePhotoToImage: Test default field values and null handling.
I will keep the changes limited to the test file without modifying existing source code. I will also ensure the tests follow the project's existing testing conventions and verify that linting, type-checking, and the full test suite pass.
I look forward to contributing to the project!
Thank you.
Sorry @avika269 but I proposed this issue and would like to work on it. I have also made plans regarding this, so can you please contribute to another issue. Thank you for understanding
@rohan-pandeyy can you assign me this issue?
@rohan-pandeyy can you assign me this issue?