Skip to content

testing: unit tests for user-places, user-events, utils.isMissingTableError, map.directionsUrl, exam-dates #155

Description

@shauryagangrade

Context

npm run test:unit covers geo/share/places/places-api/city-pages/jsonld/og/changelog/awesome-list, but several lib modules have zero coverage:

Module What to test
src/lib/user-places.ts mapping (userPlaceToPlace), error classification
src/lib/user-events.ts CRUD payload shapes, date handling
src/lib/utils.ts isMissingTableError() against real Postgres error shapes (code 42P01 etc.)
src/lib/map.ts directionsUrl() output format
src/lib/exam-dates.ts structural invariants: sorted dates, required fields, no past-dated events still marked upcoming

Supabase-dependent modules need the client mocked (vitest module mocking); the pure ones are trivial wins.

Acceptance criteria

  • Each listed module has meaningful tests passing via npm run test:unit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions