🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
import { describe, expect, it } from 'vitest';
import { serializeArtboardReference, serializeArtboardReferences } from './serialize';
const t = (key: string, options?: Record<string, unknown>) =>
({ 'artboard.chat.quote': `Re: ${options?.target}` })[key] ?? key;
const ref = { artboardId: 'art_1', itemId: 'b1', itemTitle: 'A', text: 'x' };
describe('serializeArtboardReference', () => {
it('quotes a comment with the artboard and the board it points at', () => {
expect(
serializeArtboardReference(
{ ...ref, itemTitle: '空项目', text: 'åŠ ä¸€ä¸ªè¿”å›žæŒ‰é’®\n文案改çŸ' },
t,
),
).toBe('> Re: b1 · 空项目 · artboard art_1\n> åŠ ä¸€ä¸ªè¿”å›žæŒ‰é’®\n> 文案改çŸ');
});
it('separates several references so each stays its own quote', () => {
expect(serializeArtboardReferences([ref, { ...ref, itemId: 'b2', itemTitle: 'B' }], t)).toBe(
'> Re: b1 · A · artboard art_1\n> x\n\n> Re: b2 · B · artboard art_1\n> x',
);
});
it('quotes a board with no remark as a single line', () => {
expect(serializeArtboardReference({ ...ref, text: '' }, t)).toBe(
'> Re: b1 · A · artboard art_1',
);
});
});