Skip to content

test: cover supported file-type detection helpers #52

Description

@McanKul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededtestsTest coverage and test infrastructure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions