Skip to content

test(common): add missing test coverage for useLikePlays hook#1711

Open
riteshrana12-dev wants to merge 1 commit intoreactplay:mainfrom
riteshrana12-dev:test/add-uselikeplay-hook-tests
Open

test(common): add missing test coverage for useLikePlays hook#1711
riteshrana12-dev wants to merge 1 commit intoreactplay:mainfrom
riteshrana12-dev:test/add-uselikeplay-hook-tests

Conversation

@riteshrana12-dev
Copy link
Copy Markdown

I have read the ReactPlay Contributor Guidelines and Discussion
I have reviewed the ReactPlay Code Review Checklist
I have tested my changes locally and verified there are no new warnings or errors

Description

The useLikePlays hook in src/common/hooks/useLikePlays.js had incomplete
test coverage. Added 3 new test cases to useLikePlays.test.js:

  • Verify likePlay calls likeIndividualPlay with correct argument
  • Verify unLikePlay calls unlikeIndividualPlay with correct argument
  • Verify hook returns both likePlay and unLikePlay functions

Total tests increased from 4 to 7, all passing.

Fixes #1710

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Ran the test suite with:
npm test -- --watchAll=false --testPathPattern=useLikePlays

Result: 7 passed, 7 total, 0 failures
Linter passes clean with npm run lint:fix.

Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

👷 Deploy request for reactplayio pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f2dc9b3

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

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.

🐛 [Bug report]: Missing test coverage for useLikePlays hook

1 participant