Skip to content

test(useEventListener): add test to verify event listener behavior#108

Merged
DavidHDev merged 1 commit intoDavidHDev:mainfrom
artursilveiradev:feat/89-tests-use-event-listener-hook
Feb 1, 2025
Merged

test(useEventListener): add test to verify event listener behavior#108
DavidHDev merged 1 commit intoDavidHDev:mainfrom
artursilveiradev:feat/89-tests-use-event-listener-hook

Conversation

@artursilveiradev
Copy link
Copy Markdown
Contributor

This PR adds a test to cover the behavior of the useEventListener hook. The test verifies that the hook correctly adds a listener for the click event and that the handler function is called when the event is triggered. Additionally, after unmounting the hook, a new click event is dispatched to ensure that the handler is not called again, validating the removal of the event listener.

@DavidHDev
Copy link
Copy Markdown
Owner

awesome! Thanks for adding!

@DavidHDev DavidHDev merged commit ab9c861 into DavidHDev:main Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants