Skip to content

Commit c9f52cc

Browse files
committed
fix: use testid instead of placeholder for e2e test element lookup
1 parent 24751b0 commit c9f52cc

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

e2e/conversation.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test.describe('Conversation Flow', () => {
122122
const message = 'Hello. We are testing, just say exactly "Hello world" without anything else.';
123123

124124
// Type a message
125-
await page.getByPlaceholder('Send a message...').fill(message);
125+
await page.getByTestId('chat-input').fill(message);
126126
await page.keyboard.press('Enter');
127127

128128
// Should show the message in the conversation

src/components/BrowserPreview.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export const BrowserPreview: FC<Props> = ({ defaultUrl = 'http://localhost:8080'
3131

3232
const handleRefresh = () => {
3333
// Force refresh by appending a dummy parameter if URL is unchanged
34-
setCurrentUrl(inputValue === currentUrl ? `${inputValue}${inputValue.includes('?') ? '&' : '?'}_refresh=${Date.now()}` : inputValue);
34+
setCurrentUrl(
35+
inputValue === currentUrl
36+
? `${inputValue}${inputValue.includes('?') ? '&' : '?'}_refresh=${Date.now()}`
37+
: inputValue
38+
);
3539
setLogs([]); // Clear logs on refresh
3640
};
3741

src/components/ChatInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const ChatInput: FC<Props> = ({
129129
<Textarea
130130
ref={textareaRef}
131131
value={message}
132+
data-testid="chat-input"
132133
onChange={(e) => {
133134
setMessage(e.target.value);
134135
// Auto-adjust height

0 commit comments

Comments
 (0)