agent-ecosystem/test/renderer/components/team/activity/LeadThoughtsGroup.test.ts
iliya 94fc564bf5 feat: UI improvements, bug fixes, and protocol noise filtering
- Fix incorrect error message when attaching files to team lead while team is offline
- Kanban columns: color only on headers, body with 30% alpha tint per user preference
- Worktree projects now correctly detected on Dashboard via path-based detection
- Filter raw protocol messages (idle_notification, teammate-message) from lead thoughts
- Consistent text styles in Attachments section (From original message / From comments)
- Secondary sort for teams by lastActivity timestamp with alphabetical fallback
- Remove colored background from team cards, keep only left border
- Dynamic member color in Add Members dialog based on next available palette color
- Stylized @-mentions in task comments with colored MemberBadge
- Refactor CLI env resolution to shared utility
2026-03-24 17:47:15 +02:00

83 lines
2.4 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { isLeadThought } from '../../../../../src/renderer/components/team/activity/LeadThoughtsGroup';
describe('LeadThoughtsGroup', () => {
it('does not classify outbound runtime messages with recipients as lead thoughts', () => {
expect(
isLeadThought({
from: 'team-lead',
to: 'alice',
text: 'Please check task #abcd1234',
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_process',
})
).toBe(false);
});
it('filters out idle_notification JSON noise from lead thoughts', () => {
expect(
isLeadThought({
from: 'team-lead',
text: '{"type":"idle_notification","message":"alice is idle"}',
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_session',
})
).toBe(false);
});
it('filters out shutdown_request JSON noise from lead thoughts', () => {
expect(
isLeadThought({
from: 'team-lead',
text: '{"type":"shutdown_request","reason":"Task complete"}',
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_process',
})
).toBe(false);
});
it('filters out pure <teammate-message> XML blocks from lead thoughts', () => {
expect(
isLeadThought({
from: 'team-lead',
text: '<teammate-message teammate_id="researcher" color="#4CAF50" summary="Done">Task completed</teammate-message>',
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_session',
})
).toBe(false);
});
it('filters out multiple <teammate-message> blocks with whitespace', () => {
const text = [
'<teammate-message teammate_id="alice" color="#f00" summary="hi">Hello</teammate-message>',
'',
'<teammate-message teammate_id="bob" color="#0f0" summary="ok">OK</teammate-message>',
].join('\n');
expect(
isLeadThought({
from: 'team-lead',
text,
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_process',
})
).toBe(false);
});
it('keeps normal lead thoughts with real content', () => {
expect(
isLeadThought({
from: 'team-lead',
text: 'Reviewing the implementation plan for the new feature.',
timestamp: '2026-03-08T00:00:00.000Z',
read: true,
source: 'lead_session',
})
).toBe(true);
});
});