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: add unit test for chathistorybutton #170

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

deeola
Copy link
Contributor

@deeola deeola commented Oct 8, 2024

Description

Unit test for ChathHistoryButton

Closes #(issue)

[#146 ]

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?

Test for the following

  • calls showchathistory when clicked, changes styles when hovered, and rendering the button correctly

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)

@@ -55,6 +55,8 @@ const ChatHistoryButton = () => {
showChatHistory();
}}
className="rcb-view-history-button"
role="button"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tjtanjin By the way, is there why we can't just use a button tag here instead of a div? I'm not sure what the decision is and that is why I added the role instead.

Copy link
Owner

Choose a reason for hiding this comment

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

Hey @deeola, adding of role here is correct. As for your question, we go with a <div> for greater flexibility and consistency in layout and styling. This helps to minimize instances where the chatbot appears to be different when added to various websites.

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 fd9d320 into tjtanjin:main Oct 9, 2024
11 checks passed
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