Files
AndreaSlopFotografie/aidlc-docs/features/portfolio-page/construction/build-and-test/unit-test-instructions.md
T
SluijsensandClaude Opus 5.5 2246986d77
Continuous Integration / check (pull_request) Successful in 13m30s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 14m13s
Continuous Integration / deploy-production (pull_request) Skipped
Marks the portfolio page as built and tested
Records the build and test results (full suite, integration scenarios,
Lighthouse in CI and locally) and completes the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 20:25:19 +01:00

1.1 KiB

Unit Test Execution — Portfolio Page

cd web
pnpm test        # vitest run with v8 coverage; fast-check seed is logged (config/testSeed.ts)

Expected

  • 82 test files, 460 tests, 0 failures (as of 9efa7fc)
  • Coverage thresholds met: 100% for src/lib/**, src/seo.ts, src/sitemap.ts (incl. the new portfolioFilters, wrapIndex, swipeDirection, masonryRowSpan, neighbourIndexes, lightboxReducer, galleryImages); overall 95.3% statements
  • Property-based tests (PBT-02..07): round-trip (wrapIndex, shootFromSearch), invariants, idempotence (filterPhotos, wrapIndex), oracles (neighbourIndexes, shootTypesWithPhotos, toGalleryItems), stateful (lightboxReducer); a failure prints the seed and the shrunk counterexample — rerun with that seed

jsdom limits handled in tests (documented in the test files)

  • The dialog's focus trap needs layout boxes: the focus test stubs getClientRects
  • Chakra removes a closed dialog after its fade-out, which needs real animation events: tests check data-state="closed" and the callbacks