feat(小宝预警): 同步今日日报证据
This commit is contained in:
@@ -148,6 +148,80 @@ test('buildVersionDailyEvidence groups version activity and detects no activity/
|
||||
assert.ok(evidence.silentRisks?.some((risk) => risk.key === 'no_activity' && risk.itemId === 'plan-1'));
|
||||
});
|
||||
|
||||
test('buildVersionDailyEvidence mirrors daily report timestamp fallback evidence', () => {
|
||||
const workItems = buildXiaobaoWorkItems({
|
||||
plans: [
|
||||
plan({
|
||||
id: 'plan-created',
|
||||
title: '新建产品方案',
|
||||
status: 'pending',
|
||||
createdAt: '2026-06-29T01:00:00.000Z',
|
||||
actualStartAt: undefined,
|
||||
}),
|
||||
],
|
||||
devTasks: [
|
||||
devTask({
|
||||
id: 'dev-started',
|
||||
title: '开始开发风险列表',
|
||||
status: 'in_progress',
|
||||
actualStartAt: '2026-06-29T02:00:00.000Z',
|
||||
createdAt: '2026-06-28T01:00:00.000Z',
|
||||
updatedAt: '2026-06-29T02:00:00.000Z',
|
||||
}),
|
||||
devTask({
|
||||
id: 'dev-submitted',
|
||||
title: '提交风险列表',
|
||||
status: 'submitted',
|
||||
actualStartAt: '2026-06-28T02:00:00.000Z',
|
||||
actualEndAt: '2026-06-29T03:00:00.000Z',
|
||||
createdAt: '2026-06-28T01:00:00.000Z',
|
||||
updatedAt: '2026-06-29T03:00:00.000Z',
|
||||
}),
|
||||
],
|
||||
testCases: [
|
||||
testCase({
|
||||
id: 'tc-failed',
|
||||
title: '验证风险列表失败态',
|
||||
status: 'failed',
|
||||
startedAt: '2026-06-29T03:30:00.000Z',
|
||||
completedAt: '2026-06-29T04:00:00.000Z',
|
||||
createdAt: '2026-06-28T01:00:00.000Z',
|
||||
updatedAt: '2026-06-29T04:00:00.000Z',
|
||||
}),
|
||||
],
|
||||
bugs: [
|
||||
bug({
|
||||
id: 'bug-fixed',
|
||||
title: '风险列表数量错误',
|
||||
status: 'fixed',
|
||||
createdAt: '2026-06-28T01:00:00.000Z',
|
||||
resolvedAt: '2026-06-29T05:00:00.000Z',
|
||||
updatedAt: '2026-06-29T05:00:00.000Z',
|
||||
}),
|
||||
],
|
||||
versions: [{ id: 'ver-1', name: 'V1.0', productName: 'FTB', projectName: 'PM' }],
|
||||
requirementVersionMap: new Map([['req-1', 'ver-1']]),
|
||||
});
|
||||
|
||||
const evidence = buildVersionDailyEvidence({
|
||||
versionId: 'ver-1',
|
||||
workItems,
|
||||
activities: [],
|
||||
worklogs: [],
|
||||
now: new Date('2026-06-29T08:00:00.000Z'),
|
||||
});
|
||||
|
||||
assert.deepEqual(evidence.todayCreations.map((item) => item.summary), ['新建计划:新建产品方案']);
|
||||
assert.ok(evidence.todayProgress.some((item) => item.summary === '开始开发:开始开发风险列表'));
|
||||
assert.ok(evidence.todayDeliveries.some((item) => item.summary === '已提测开发任务:提交风险列表'));
|
||||
assert.ok(evidence.todayDeliveries.some((item) => item.summary === '已修复 Bug:风险列表数量错误'));
|
||||
assert.ok(evidence.todayProgress.some((item) => item.summary === '开始测试:验证风险列表失败态'));
|
||||
assert.ok(evidence.todayRisks.some((item) => item.summary === '测试不通过:验证风险列表失败态'));
|
||||
assert.equal(evidence.totalActivityCount, 6);
|
||||
assert.equal(evidence.lastActivityAt, '2026-06-29T05:00:00.000Z');
|
||||
assert.ok(evidence.todayActualHours > 0);
|
||||
});
|
||||
|
||||
test('buildXiaobaoWorkItems keeps all version work without current-user filtering', () => {
|
||||
const items = buildXiaobaoWorkItems({
|
||||
plans: [plan({ owner: 'pm-other' })],
|
||||
|
||||
Reference in New Issue
Block a user