Goal
Add focused unit coverage for the file-type helpers in src/lib/fileTypes.ts so changes to accepted import formats cannot silently break drag-and-drop or file-picker behavior.
Scope
- Add
src/lib/fileTypes.test.ts.
- Exercise
isImagePath, isPdfPath, isOfficePath and isSupportedPath directly.
- Keep the tests pure; no Tauri runtime or fixture files are required.
Acceptance criteria
- Image coverage includes PNG, JPG/JPEG, GIF, BMP, WebP, TIF/TIFF and HEIC/HEIF.
- Office coverage includes DOC/DOCX, XLS/XLSX, PPT/PPTX, ODT/ODS/ODP, RTF, CSV and HTM/HTML.
- PDF, image and Office extensions are accepted with mixed-case filenames and both POSIX and Windows-style paths.
isSupportedPath is verified as the union of the three supported groups.
- Missing extensions, unsupported extensions and near misses such as
report.pdf.exe, photo.heic.tmp, SVG and DOCM are rejected.
- Production behavior stays unchanged unless a test exposes a documented defect.
Verification
npm test -- src/lib/fileTypes.test.ts
npm run typecheck
Goal
Add focused unit coverage for the file-type helpers in
src/lib/fileTypes.tsso changes to accepted import formats cannot silently break drag-and-drop or file-picker behavior.Scope
src/lib/fileTypes.test.ts.isImagePath,isPdfPath,isOfficePathandisSupportedPathdirectly.Acceptance criteria
isSupportedPathis verified as the union of the three supported groups.report.pdf.exe,photo.heic.tmp, SVG and DOCM are rejected.Verification
npm test -- src/lib/fileTypes.test.ts npm run typecheck