-
Notifications
You must be signed in to change notification settings - Fork 0
test(chat): align ChatInterface selector hooks #2085
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -360,6 +360,7 @@ export function ChatInterface({ | |||||||||||||||||||||||
| <div className="flex items-center gap-3"> | ||||||||||||||||||||||||
| <h2 className="text-lg font-semibold">AI Chat</h2> | ||||||||||||||||||||||||
| <ModelDisplay | ||||||||||||||||||||||||
| data-testid="model-badge" | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
MODEL_FILE="$(fd 'ModelDisplay.tsx$' src | head -n 1)"
echo "Inspecting: ${MODEL_FILE}"
cat -n "${MODEL_FILE}"
echo
echo "Prop-forwarding signal check:"
rg -n "data-testid|\\.\\.\\.|HTMLAttributes|ComponentProps|props" "${MODEL_FILE}"Repository: ryanmaclean/vibecode-webgui Length of output: 10704 Fix The component's 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| model={availableModels.find((m) => m.id === selectedModel)} | ||||||||||||||||||||||||
| compact | ||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||
|
Comment on lines
362
to
366
|
||||||||||||||||||||||||
| <ModelDisplay | |
| data-testid="model-badge" | |
| model={availableModels.find((m) => m.id === selectedModel)} | |
| compact | |
| /> | |
| <div data-testid="model-badge"> | |
| <ModelDisplay | |
| model={availableModels.find((m) => m.id === selectedModel)} | |
| compact | |
| /> | |
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing
data-testidto<ModelDisplay>here does not actually create amodel-badgeelement in the DOM, becauseModelDisplaycurrently only destructuresmodel,className,showDetails, andcompactand never forwards extra props to its root node (src/components/ai/ModelDisplay.tsx). In this scenario, selectors likegetByTestId('model-badge')in the updated tests (and the existing e2e locator) still fail, so the selector-alignment fix remains broken.Useful? React with 👍 / 👎.