You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search module has minimal tests: 13 files covered by one service spec
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/search/ spans 13 files (search, autocomplete, facets, filters, history, export, image search, voice search) yet has just 1 spec (search.service.spec.ts, plus test/unit/search-facets.service.spec.ts). Autocomplete ranking, filter composition, and history behavior — including the in-memory fallback (#50) — are unpinned. A regression in facet or autocomplete logic ships silently.
Why this is architecturally hard
Query composition is the test design. Filter/facet logic builds Prisma where clauses; tests must assert on the composed query shapes, which needs good mock fixtures.
Several services share the module. Autocomplete, history, filters, and export each need coverage; the plan must scope per service.
Acceptance criteria
Tests cover autocomplete suggestion ranking, facet counts, and filter composition.
Search module has minimal tests: 13 files covered by one service spec
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/search/spans 13 files (search, autocomplete, facets, filters, history, export, image search, voice search) yet has just 1 spec (search.service.spec.ts, plustest/unit/search-facets.service.spec.ts). Autocomplete ranking, filter composition, and history behavior — including the in-memory fallback (#50) — are unpinned. A regression in facet or autocomplete logic ships silently.Why this is architecturally hard
whereclauses; tests must assert on the composed query shapes, which needs good mock fixtures.Acceptance criteria
npm test.Out of scope
Changing search behavior; the history durability migration (#50).
Getting started
src/search/search-autocomplete.service.ts— the autocomplete logicsrc/search/search-filters.service.ts— the filter compositionCommands:
npm test,npm run test:cov.Good first files to read:
src/search/search.service.spec.ts,src/search/search-autocomplete.service.ts.