web/hooks/useMobileUpload.ts contains several pure utility functions that are easily testable without any React rendering:
Current exported functions (paths and line numbers verified 2026-09 after the Next.js App Router restructure):
formatFileSize() (line 39) — formats bytes to human-readable sizes
isFilePickerSupported() (line 46) — checks API support
isIOSSafari() (line 50) — browser detection
isMobileDevice() (line 55) — mobile detection
Internal helpers fileId(), selectWithInput(), and summarize() are worth covering indirectly through the hook's public behavior.
What to do:
- Create
web/hooks/__tests__/useMobileUpload.test.ts
- Write tests for each exported function, covering edge cases:
formatFileSize(0), negative values, very large values
- detection helpers under different user-agent mocks
- Run:
cd web && pnpm test:run hooks/__tests__/useMobileUpload.test.ts
Skills needed: TypeScript, Vitest
Estimated time: 1-2 hours
web/hooks/useMobileUpload.tscontains several pure utility functions that are easily testable without any React rendering:Current exported functions (paths and line numbers verified 2026-09 after the Next.js App Router restructure):
formatFileSize()(line 39) — formats bytes to human-readable sizesisFilePickerSupported()(line 46) — checks API supportisIOSSafari()(line 50) — browser detectionisMobileDevice()(line 55) — mobile detectionInternal helpers
fileId(),selectWithInput(), andsummarize()are worth covering indirectly through the hook's public behavior.What to do:
web/hooks/__tests__/useMobileUpload.test.tsformatFileSize(0), negative values, very large valuescd web && pnpm test:run hooks/__tests__/useMobileUpload.test.tsSkills needed: TypeScript, Vitest
Estimated time: 1-2 hours