33 lines
904 B
TypeScript
33 lines
904 B
TypeScript
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}
|
|
suppressProcessAttachments
|
|
/>,
|
|
);
|
|
|
|
expect(screen.getByAltText('artifact.png')).toBeInTheDocument();
|
|
});
|
|
});
|