Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit tests for userFlowInternal Hook #206

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Prithwi32
Copy link
Contributor

Description

This update introduces unit tests for the useFlowInternal hook, covering various scenarios such as retrieving initial context values, handling the flow state, and ensuring proper behavior of the restartFlow functionality. These tests aim to increase the reliability of the hook by verifying its interaction with contexts like MessagesContext, PathsContext, ToastsContext, BotRefsContext, and BotStatesContext.
Issue: [Task] Add unit test cases for useFlowInternal hook #129

Closes #129

What change does this PR introduce?

Please select the relevant option(s).

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to docs/code comments)

What is the proposed approach?

The proposed approach involves mocking the relevant contexts used within the useFlowInternal hook, then utilizing the @testing-library/react renderHook and act functions to simulate real usage scenarios.

Checklist:

  • The commit message follows our adopted guidelines
  • Testing has been done for the change(s) added (for bug fixes/features)
  • Relevant comments/docs have been added/updated (for bug fixes/features)

@Prithwi32
Copy link
Contributor Author

@tjtanjin could u review PR and let me know feedback..Thank YOU :)

Copy link
Owner

@tjtanjin tjtanjin left a comment

Choose a reason for hiding this comment

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

LGTM! 😊

@tjtanjin tjtanjin merged commit 8f7012f into tjtanjin:main Oct 15, 2024
11 checks passed
RAVEYUS pushed a commit to RAVEYUS/react-chatbotify that referenced this pull request Nov 2, 2024
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.

[Task] Add unit test cases for useFlowInternal hook
2 participants