fix(ai): 拆解原型无需求ID任务
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { getWorkspacePendingCount } from './workspace-engine';
|
||||
import { aggregateWorkItems, getWorkspacePendingCount } from './workspace-engine';
|
||||
import type { DevTask } from './dev-task';
|
||||
|
||||
test('getWorkspacePendingCount counts unfinished work items only', () => {
|
||||
const count = getWorkspacePendingCount([
|
||||
@@ -11,3 +12,37 @@ test('getWorkspacePendingCount counts unfinished work items only', () => {
|
||||
|
||||
assert.equal(count, 2);
|
||||
});
|
||||
|
||||
test('aggregateWorkItems uses direct version id for no-requirement dev tasks', () => {
|
||||
const task = {
|
||||
id: 'dev-no-req',
|
||||
taskNo: 'DEV-001',
|
||||
versionId: 'ver-1',
|
||||
requirementId: '',
|
||||
requirementName: '预入职人员支持',
|
||||
title: '实现预入职人员选择',
|
||||
categoryId: 'frontend',
|
||||
assigneeId: '张三',
|
||||
priority: 'P1',
|
||||
expectedStartAt: '',
|
||||
expectedEndAt: '',
|
||||
status: 'todo',
|
||||
isBlocked: false,
|
||||
createdBy: 'AI',
|
||||
createdAt: '2026-06-29T09:00:00.000Z',
|
||||
updatedAt: '2026-06-29T09:00:00.000Z',
|
||||
} as DevTask;
|
||||
|
||||
const items = aggregateWorkItems(
|
||||
'张三',
|
||||
[],
|
||||
[task],
|
||||
[],
|
||||
[],
|
||||
new Map([['ver-1', { id: 'ver-1', name: 'V1.0', productName: 'FTB', projectName: 'PM' }]]),
|
||||
new Map(),
|
||||
);
|
||||
|
||||
assert.equal(items[0].versionId, 'ver-1');
|
||||
assert.equal(items[0].versionName, 'V1.0');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user