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

Test: unit test cases for ChatBotContainer component #252

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

georgeolson92
Copy link
Contributor

Description

This pull request introduces unit tests for the ChatBotContainer component, ensuring that the component correctly renders the header, input, and footer buttons based on the settings provided by the useSettingsContext.

Closes #222

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 approach taken involves mocking the useSettingsContext hook to control the settings for the ChatBotContainer component. Three separate tests have been implemented to verify that the correct buttons are rendered based on the configuration of showHeader, showInputRow, and showFooter settings. Each test checks the presence or absence of the relevant buttons in the rendered output.

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)

@tjtanjin
Copy link
Owner

Hey @georgeolson92! Trouble you to merge in the main branch, there're some fixes on main required for pipeline to pass 🥹

@tjtanjin
Copy link
Owner

tjtanjin commented Oct 31, 2024

Seeing as we're very close to the deadline, I'll merge this PR first and address any fixes if necessary.

Update: tests are failing, skipping for now but a separate PR to fix it would be great.

@tjtanjin tjtanjin merged commit f51a2a0 into tjtanjin:main Oct 31, 2024
3 of 5 checks passed
@georgeolson92
Copy link
Contributor Author

Update: tests are failing, skipping for now but a separate PR to fix it would be great.

I will go ahead and get working on those failing tests and create a new PR, thank you for the help!

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 ChatBotContainer component
3 participants