Skip to content

test: cover poster page tiling calculations #18

Description

@McanKul

Goal

Add focused unit coverage for the pure poster and paper-size helpers.

Files

  • Add src/lib/paper.test.ts.
  • Change src/lib/paper.ts only if a test exposes a real defect.

Acceptance criteria

  • paperPt covers A4 conversion plus portrait/landscape dimension swapping using toBeCloseTo.
  • tileCount covers exact fit, the 0.5 pt tolerance, first overflow, multiple sheets, and overlap increasing the sheet count.
  • gridFor covers explicit orientation, count === cols * rows, auto-orientation for both tall and wide pages, and deterministic portrait selection on ties.
  • describeSize recognizes A-series sizes in either orientation and rounds a custom size.
  • Tests are pure and need no PDF fixture or Tauri runtime.

Verify

npm test -- src/lib/paper.test.ts
npm run typecheck

Start from development and open the pull request against development. Comment here if you would like the issue assigned.

Metadata

Metadata

Assignees

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