PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

Add unit tests for personUtils.ts

Open mystic-fae opened this issue 2 weeks ago • 4 comments

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.

mystic-fae avatar Nov 12 '26 13:11 mystic-fae

👋 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 :)

github-actions[bot] avatar Nov 12 '26 13:11 github-actions[bot]

Link your account with Gitcord

Thanks for opening this issue, @mystic-fae!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link mystic-fae
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link mystic-fae)

Once linked, Gitcord can notify you about assignments, mentions, and more.

— Posted by Gitcord

gitcordapp[bot] avatar Nov 12 '26 13:11 gitcordapp[bot]

@rohan-pandeyy can you assign me this issue?

mystic-fae avatar Nov 16 '26 16:11 mystic-fae

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.

avika269 avatar Nov 17 '26 05:11 avika269

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

mystic-fae avatar Nov 17 '26 07:11 mystic-fae

@rohan-pandeyy can you assign me this issue?

mystic-fae avatar Nov 23 '26 10:11 mystic-fae

@rohan-pandeyy can you assign me this issue?

mystic-fae avatar Nov 26 '26 12:11 mystic-fae