feat: added data test id#165
Open
LAVI9966 wants to merge 4 commits intoWalkover-Web-Solution:testingfrom
Open
Conversation
- Add data-testid to ChatbotTextField component (input, buttons, file upload, emoji, etc.) - Add data-testid to main Chatbot component (containers, views, loading states) - Add data-testid to MessageList component (messages, scroll container, loading indicators) - Follow same pattern as AI-middleware-frontend repo for consistent testing - Enable automated testing and QA testing with proper element identification
- Add data-testid to CallButton component (voice call button) - Add data-testid to EmojiSelector component (picker, search, categories, emojis) - Add data-testid to ChatbotHeader component (all interactive buttons and dropdowns) - Complete comprehensive test coverage for all major UI elements - Enable full automated testing capabilities across chatbot interface
|
PR review rate limit exceeded |
There was a problem hiding this comment.
Pull request overview
Adds test hooks to the chatbot UI by introducing data-testid attributes across key components, and extends app info typing to include optional “show” button flags.
Changes:
- Added
data-testidattributes to chatbot views, message list states, input controls, emoji picker, and call button to support UI testing. - Added
data-testidfor empty/active chatbot containers and loading indicators. - Extended
$AppInfoReduxTypewith optionalshowFullScreenButton/showCloseButtonflags.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| types/appInfo/appInfoReduxType.ts | Adds optional “show” button flags to app info redux typing. |
| components/Interface-Chatbot/Messages/MessageList.tsx | Adds test ids for thinking indicator, loader, scroll container, and per-message elements. |
| components/Interface-Chatbot/EmojiSelector.tsx | Adds test ids for emoji picker elements (picker, search, loading/empty, categories, emojis). |
| components/Interface-Chatbot/ChatbotTextField.tsx | Adds test ids for suggestions, upload controls, error message, input container, emoji button, and send button. |
| components/Interface-Chatbot/CallButton.tsx | Adds a test id to the call button wrapper. |
| components/Chatbot/Chatbot.tsx | Adds test ids for empty/active views and main layout containers/indicators. |
Comments suppressed due to low confidence (1)
components/Interface-Chatbot/Messages/MessageList.tsx:163
data-testidis being passed to theMessageReact component, butMessageProps(components/Interface-Chatbot/Messages/Message.tsx) doesn't declare it and the component doesn't forward unknown props to its root element. This will cause a TypeScript error and the test id won't end up in the DOM. Consider adding an explicit prop (e.g.,testId) toMessagePropsand applying it to the root<div>, or extendMessagePropsfromReact.HTMLAttributes<HTMLDivElement>and spread the remaining props onto the wrapper element.
<Message
key={`${msgId}`}
data-testid={`chatbot-message-${msgId}`}
message={message}
prevTime={prevTime}
isLastMessage={index === lastHumanOrBotIndex}
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f99b654 to
2072cb6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.