feat(版本): 完善计划覆盖与工作台待办
关键改动: - 增加计划日志汇总、需求覆盖草稿校验与对应测试 - 抽取工作台工作项 Hook,补充待办计数能力 - 优化版本详情中计划、任务、测试用例和 Bug 的筛选与展示 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
@@ -36,6 +36,54 @@ test('sortPlansNewestFirst places newly created plans before older plans', () =>
|
||||
assert.deepEqual(plans.map((item) => item.id), ['plan-100', 'manual-old', 'plan-300']);
|
||||
});
|
||||
|
||||
test('collects logs across plans with plan context and newest first', () => {
|
||||
const getPlanLogsForPlans = (versionPlan as any).getPlanLogsForPlans as undefined | ((plans: VersionPlan[]) => Array<{
|
||||
id: string;
|
||||
planId: string;
|
||||
planTitle: string;
|
||||
createdAt: string;
|
||||
}>);
|
||||
assert.equal(typeof getPlanLogsForPlans, 'function');
|
||||
|
||||
const logs = getPlanLogsForPlans!([
|
||||
plan({
|
||||
id: 'plan-a',
|
||||
title: '产品方案第一天',
|
||||
logs: [
|
||||
{
|
||||
id: 'log-old',
|
||||
type: 'system',
|
||||
title: '开始计划',
|
||||
actor: 'PM',
|
||||
createdAt: '2026-06-29T09:00:00.000Z',
|
||||
},
|
||||
],
|
||||
}),
|
||||
plan({
|
||||
id: 'plan-b',
|
||||
title: '产品方案第二天',
|
||||
logs: [
|
||||
{
|
||||
id: 'log-new',
|
||||
type: 'requirement_progress',
|
||||
title: '更新需求进度',
|
||||
actor: 'PM',
|
||||
createdAt: '2026-06-29T15:00:00.000Z',
|
||||
},
|
||||
],
|
||||
}),
|
||||
]);
|
||||
|
||||
assert.deepEqual(logs.map((log) => ({
|
||||
id: log.id,
|
||||
planId: log.planId,
|
||||
planTitle: log.planTitle,
|
||||
})), [
|
||||
{ id: 'log-new', planId: 'plan-b', planTitle: '产品方案第二天' },
|
||||
{ id: 'log-old', planId: 'plan-a', planTitle: '产品方案第一天' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('derives requirement coverage from new records and legacy completed ids', () => {
|
||||
const getRequirementCoverageStatus = (versionPlan as any).getRequirementCoverageStatus as undefined | ((item: VersionPlan, requirementId: string) => string);
|
||||
const getRequirementCoverageSummary = (versionPlan as any).getRequirementCoverageSummary as undefined | ((item: VersionPlan) => {
|
||||
@@ -116,3 +164,17 @@ test('updates requirement coverage, syncs legacy completed ids, and creates a pl
|
||||
assert.equal(next.logs?.[0]?.actor, 'PM');
|
||||
assert.equal(next.logs?.[0]?.requirementCode, 'QY0001');
|
||||
});
|
||||
|
||||
test('validates requirement coverage record drafts by status', () => {
|
||||
const canSaveRequirementCoverageDraft = (versionPlan as any).canSaveRequirementCoverageDraft as undefined | ((
|
||||
status: string,
|
||||
completedContent?: string,
|
||||
remainingContent?: string,
|
||||
) => boolean);
|
||||
assert.equal(typeof canSaveRequirementCoverageDraft, 'function');
|
||||
|
||||
assert.equal(canSaveRequirementCoverageDraft!('completed'), true);
|
||||
assert.equal(canSaveRequirementCoverageDraft!('partial', '完成主流程', ''), false);
|
||||
assert.equal(canSaveRequirementCoverageDraft!('partial', '完成主流程', '补充异常状态'), true);
|
||||
assert.equal(canSaveRequirementCoverageDraft!('not_started'), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user