Skip to content

Add integration test for useDebounce hook cleaning up timeout on component unmount #498

Description

@Chucks1093

Summary

The useDebounce hook sets a timeout that must be cleared when the component unmounts to avoid state updates on an unmounted component. An integration test should confirm the timeout is cleaned up correctly.

Scope

  • Render a component using useDebounce and trigger a value change
  • Unmount the component before the debounce delay elapses
  • Assert no state update or warning occurs after unmount
  • Use fake timers to advance past the delay after unmount and confirm no update fires

Acceptance Criteria

  • No state update fires after component unmounts
  • No React warning about updating unmounted component
  • Timeout is cleared on unmount

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions