test: add unit tests for bboxCropStyle() utility #661

Open
opened 2026-07-20 21:26:59 +02:00 by chris · 0 comments
Owner

Summary\n\nDiscoveryThumbnail.ts bboxCropStyle() has no unit tests. Add tests covering:\n- Normal bbox (center crop + zoom)\n- Edge: bbox at image corners\n- Edge: bbox covers full image\n- Edge: zero-size bbox (fallback)\n- Clamping behavior (center stays within bounds)\n\n## Context\n\nNon-blocking follow-up from PR #660 review (Test Engineer note).\n\n## Files\n\n- apps/web/src/lib/utils/discoveryThumbnail.ts (source)\n- apps/web/src/lib/utils/discoveryThumbnail.test.ts (new)

## Summary\n\nDiscoveryThumbnail.ts `bboxCropStyle()` has no unit tests. Add tests covering:\n- Normal bbox (center crop + zoom)\n- Edge: bbox at image corners\n- Edge: bbox covers full image\n- Edge: zero-size bbox (fallback)\n- Clamping behavior (center stays within bounds)\n\n## Context\n\nNon-blocking follow-up from PR #660 review (Test Engineer note).\n\n## Files\n\n- `apps/web/src/lib/utils/discoveryThumbnail.ts` (source)\n- `apps/web/src/lib/utils/discoveryThumbnail.test.ts` (new)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories#661
No description provided.