Skip to content

useDebouncedSearch has no tests: debounced query triggering is uncovered #896

Description

@nanaf6203-bit

useDebouncedSearch has no tests: debounced query triggering is uncovered

Labels / Complexity: testing · Trivial — Trivial

Summary

useDebouncedSearch (src/hooks/useDebouncedSearch.ts) debounces search input before triggering a query. It has no tests. A regression that fires queries on every keystroke (provider/API spam) or never fires ships silently in every search box that uses it.

Proposal

  • Add a spec covering debounce timing (fake timers), rapid-input collapse, and unmount cleanup.

Acceptance criteria

  • The spec asserts the debounce window and single-trigger behavior; it passes via npm test.

Getting started

  • src/hooks/useDebouncedSearch.ts — the hook
  • src/hooks/__tests__/useToast.test.ts — the pattern

Commands: npm test.

Good first files to read: src/hooks/useDebouncedSearch.ts.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programTrivialtestingTest coverage or test reliability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions