Skip to content

testing: no test file for my-places-panel.tsx (245-line CRUD component) #263

Description

@yakew7

Problem

src/components/map/my-places-panel.tsx (245 lines — the signed-in-only "My places" panel: search/filter over a user's saved places, select-to-locate, and CRUD entry points per the closed #145) has no test file:

$ find src -name "*.test.tsx" | grep -i places
src/lib/places.test.ts
src/lib/places-api.test.ts
src/lib/user-places.test.ts

src/lib/user-places.ts (the data layer) is tested, but the panel component that renders and filters that data isn't. It owns non-trivial logic in its own right — filtering saved places by search text and city, the empty-state branching ("No saved places match this search" vs. the zero-saved-places case), and the onSelectPlace click-to-locate wiring — none of which is covered anywhere.

Comparable CRUD-adjacent components elsewhere in the app do have tests (competitions-browser.test.tsx for its filter/search logic, save-button.test.tsx, country-track-list.test.tsx), making this panel a clear outlier among "signed-in feature" components.

Fix

Add src/components/map/my-places-panel.test.tsx using the existing Testing Library conventions (see results-list.test.tsx for a comparable map-adjacent component), covering at minimum: the search/city filtering logic, the two distinct empty states, and that clicking a row calls onSelectPlace with the right place.

Acceptance criteria

  • src/components/map/my-places-panel.test.tsx exists and passes under npm run test:unit
  • Covers filtering, both empty states, and row selection

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions