Add unit tests for personUtils.ts

Open Beginner friendly
#1,707 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

@mystic-fae is already working on this.

Since Nov 14, 2026.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

Start with frontend/src/utils/personUtils.ts and look at an existing test in a sibling utils tests folder to copy its conventions. Write tests for getPersonName, getPhotoCountText, formatPeopleTitle and facePhotoToImage as listed in the issue. Done when the new test file passes along with lint and type-check, without changing source files. The author already has a working implementation, so check the two comments for a maintainer reply before starting.

Written by the indexing model from the issue text.

Description

enhancement

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)
Would it be okay if I open a PR for this?

Dominant language
Python
Stars
313
Forks
755
Avg merge
6d 36m
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/PictoPy

All issues in AOSSIE-Org/PictoPy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.