Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/src/components/Chat/Messages/MessageParts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default function Message(props: TMessageProps) {
'relative flex w-11/12 flex-col',
isCreatedByUser ? 'user-turn' : 'agent-turn',
)}
data-testid={isCreatedByUser ? 'user-message' : 'assistant-message'}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The data-testid attribute should be unique within a page. In a conversation with multiple messages, there will be multiple elements with the same 'user-message' or 'assistant-message' test ID, which violates HTML best practices and makes E2E testing unreliable. Consider making the test ID unique by incorporating the message ID, for example: data-testid={isCreatedByUser ? user-message-${messageId}:assistant-message-${messageId}}

Suggested change
data-testid={isCreatedByUser ? 'user-message' : 'assistant-message'}
data-testid={
isCreatedByUser ? `user-message-${messageId}` : `assistant-message-${messageId}`
}

Copilot uses AI. Check for mistakes.
>
<h2 className={cn('select-none font-semibold text-text-primary', fontSize)}>
{name}
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Chat/Messages/SearchMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const MessageAvatar = ({ iconData }: { iconData: TMessageIcon }) => (
const MessageBody = ({ message, messageLabel, fontSize }) => (
<div
className={cn('relative flex w-11/12 flex-col', message.isCreatedByUser ? '' : 'agent-turn')}
data-testid={message.isCreatedByUser ? 'user-message' : 'assistant-message'}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The data-testid attribute should be unique within a page. In a conversation with multiple messages, there will be multiple elements with the same 'user-message' or 'assistant-message' test ID, which violates HTML best practices and makes E2E testing unreliable. Consider making the test ID unique by incorporating the message ID, for example: data-testid={isCreatedByUser ? user-message-${messageId}:assistant-message-${messageId}} (where messageId would need to be passed as a prop to the MessageBody component)

Copilot uses AI. Check for mistakes.
>
<div className={cn('select-none font-semibold', fontSize)}>{messageLabel}</div>
<SearchContent message={message} />
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Chat/Messages/ui/MessageRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const MessageRender = memo(
'relative flex w-11/12 flex-col',
msg.isCreatedByUser ? 'user-turn' : 'agent-turn',
)}
data-testid={msg.isCreatedByUser ? 'user-message' : 'assistant-message'}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The data-testid attribute should be unique within a page. In a conversation with multiple messages, there will be multiple elements with the same 'user-message' or 'assistant-message' test ID, which violates HTML best practices and makes E2E testing unreliable. Consider making the test ID unique by incorporating the message ID, for example: data-testid={msg.isCreatedByUser ? user-message-${msg.messageId}:assistant-message-${msg.messageId}}

Suggested change
data-testid={msg.isCreatedByUser ? 'user-message' : 'assistant-message'}
data-testid={
msg.isCreatedByUser
? `user-message-${msg.messageId}`
: `assistant-message-${msg.messageId}`
}

Copilot uses AI. Check for mistakes.
>
<h2 className={cn('select-none font-semibold', fontSize)}>{messageLabel}</h2>

Expand Down
1 change: 1 addition & 0 deletions client/src/components/Messages/ContentRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const ContentRender = memo(
'relative flex w-11/12 flex-col',
msg.isCreatedByUser ? 'user-turn' : 'agent-turn',
)}
data-testid={msg.isCreatedByUser ? 'user-message' : 'assistant-message'}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The data-testid attribute should be unique within a page. In a conversation with multiple messages, there will be multiple elements with the same 'user-message' or 'assistant-message' test ID, which violates HTML best practices and makes E2E testing unreliable. Consider making the test ID unique by incorporating the message ID, for example: data-testid={msg.isCreatedByUser ? user-message-${msg.messageId}:assistant-message-${msg.messageId}}

Suggested change
data-testid={msg.isCreatedByUser ? 'user-message' : 'assistant-message'}
data-testid={
msg.isCreatedByUser
? `user-message-${msg.messageId}`
: `assistant-message-${msg.messageId}`
}

Copilot uses AI. Check for mistakes.
>
<h2 className={cn('select-none font-semibold', fontSize)}>{messageLabel}</h2>

Expand Down
1 change: 1 addition & 0 deletions client/src/components/Share/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function Message(props: TMessageProps) {
</div>
<div
className={cn('relative flex w-11/12 flex-col', isCreatedByUser ? '' : 'agent-turn')}
data-testid={isCreatedByUser ? 'user-message' : 'assistant-message'}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The data-testid attribute should be unique within a page. In a conversation with multiple messages, there will be multiple elements with the same 'user-message' or 'assistant-message' test ID, which violates HTML best practices and makes E2E testing unreliable. Consider making the test ID unique by incorporating the message ID, for example: data-testid={isCreatedByUser ? user-message-${messageId}:assistant-message-${messageId}}

Suggested change
data-testid={isCreatedByUser ? 'user-message' : 'assistant-message'}
data-testid={isCreatedByUser ? `user-message-${messageId}` : `assistant-message-${messageId}`}

Copilot uses AI. Check for mistakes.
>
<div className={cn('select-none font-semibold', fontSize)}>{messageLabel}</div>
<div className="flex-col gap-1 md:gap-3">
Expand Down