Problem
The test suite currently consists of two pure utility test files (src/utils/photo-viewer/__tests__/transformUtils.test.ts and gestureUtils.test.ts).
There are zero component or hook tests, React Testing Library is not installed, and Jest runs with --passWithNoTests.
PhotoViewer was recently refactored into 9 hooks and several sub-components (#7, PR #13), which makes it very testable, but nothing locks in its behavior.
Proposed change
- Add dev dependencies:
@testing-library/react, @testing-library/user-event, @testing-library/jest-dom.
These are dev-only, so the zero-runtime-dependency guarantee is unaffected.
- Add a jest setup file wiring in
@testing-library/jest-dom.
- Write PhotoViewer tests covering at least:
- Opens with the expected image and closes via the close control and the Escape key.
- Next/previous navigation updates the displayed image, including wrap-around behavior.
- Keyboard shortcuts from
useKeyboardShortcuts (arrow keys, Escape, zoom keys if any).
- Zoom interaction updates the transform (integration with
useTransform / useWheelZoom).
- Image preloading behavior from
useImagePreloader (adjacent images requested).
MediaGrid and ImageCarousel tests are tracked as separate follow-up issues so this one stays reviewable.
Acceptance criteria
Compatibility
Dev dependencies and tests only.
No runtime or API changes.
Problem
The test suite currently consists of two pure utility test files (
src/utils/photo-viewer/__tests__/transformUtils.test.tsandgestureUtils.test.ts).There are zero component or hook tests, React Testing Library is not installed, and Jest runs with
--passWithNoTests.PhotoViewer was recently refactored into 9 hooks and several sub-components (#7, PR #13), which makes it very testable, but nothing locks in its behavior.
Proposed change
@testing-library/react,@testing-library/user-event,@testing-library/jest-dom.These are dev-only, so the zero-runtime-dependency guarantee is unaffected.
@testing-library/jest-dom.useKeyboardShortcuts(arrow keys, Escape, zoom keys if any).useTransform/useWheelZoom).useImagePreloader(adjacent images requested).MediaGrid and ImageCarousel tests are tracked as separate follow-up issues so this one stays reviewable.
Acceptance criteria
--passWithNoTestsremoved from thetestscript.Compatibility
Dev dependencies and tests only.
No runtime or API changes.