Refine chat tool status dedupe (#786)
Co-authored-by: zuolingxuan <zuolingxuan@bytedance.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
32d14b8cf9
commit
25b13ab912
33
tests/unit/chat-message.test.tsx
Normal file
33
tests/unit/chat-message.test.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { ChatMessage } from '@/pages/Chat/ChatMessage';
|
||||
import type { RawMessage } from '@/stores/chat';
|
||||
|
||||
describe('ChatMessage attachment dedupe', () => {
|
||||
it('keeps attachment-only assistant replies visible even when process attachments are suppressed', () => {
|
||||
const message: RawMessage = {
|
||||
role: 'assistant',
|
||||
content: [],
|
||||
_attachedFiles: [
|
||||
{
|
||||
fileName: 'artifact.png',
|
||||
mimeType: 'image/png',
|
||||
fileSize: 0,
|
||||
preview: '/tmp/artifact.png',
|
||||
filePath: '/tmp/artifact.png',
|
||||
source: 'tool-result',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
render(
|
||||
<ChatMessage
|
||||
message={message}
|
||||
showThinking={false}
|
||||
suppressProcessAttachments
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByAltText('artifact.png')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user