Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
import type { TFile } from 'librechat-data-provider';
import { getAttachmentTitleText } from './context';
const file = (filename?: string): TFile => ({ filename }) as TFile;
describe('getAttachmentTitleText', () => {
it('returns an empty string when there are no files', () => {
expect(getAttachmentTitleText()).toBe('');
expect(getAttachmentTitleText(null)).toBe('');
expect(getAttachmentTitleText([])).toBe('');
});
it('lists a single filename', () => {
expect(getAttachmentTitleText([file('report.pdf')])).toBe('Attached file(s): report.pdf');
});
it('lists every filename', () => {
expect(getAttachmentTitleText([file('a.pdf'), file('b.csv')])).toBe(
'Attached file(s): a.pdf, b.csv',
);
});
it('skips files that carry no filename', () => {
expect(getAttachmentTitleText([file(), file('kept.txt')])).toBe('Attached file(s): kept.txt');
});
it('returns an empty string when no file has a filename', () => {
expect(getAttachmentTitleText([file(), file()])).toBe('');
});
});