import { describe, expect, it } from 'vitest' import { hasActiveProgressCard } from '../src/components/Workbench' import type { ActivityCard } from '@ui' function card(over: Partial): ActivityCard { return { id: 'card_1', projectId: 'prj_1', conversationId: 'cnv_1', kind: 'progress', title: '材料整理', status: 'active', tone: 'info', createdAt: '2026-10-12T10:00:00Z', updatedAt: '2026-10-12T10:00:00Z', ...over, } } describe('hasActiveProgressCard', () => { it('active/action_required progress 卡视为占用当前任务位', () => { expect(hasActiveProgressCard([card({ status: 'active' })])).toBe(true) expect(hasActiveProgressCard([card({ status: 'action_required' })])).toBe(true) }) it('完成/失败 progress 或非 progress 不隐藏 CurrentTaskCard', () => { expect(hasActiveProgressCard([card({ status: 'done', tone: 'ok' })])).toBe(false) expect(hasActiveProgressCard([card({ status: 'failed', tone: 'danger' })])).toBe(false) expect(hasActiveProgressCard([card({ kind: 'confirm', status: 'action_required' })])).toBe(false) expect(hasActiveProgressCard([])).toBe(false) }) })