feat(ai): 优化拆解重跑与结果展示

This commit is contained in:
Script Generator
2026-06-26 11:01:11 +08:00
parent 55e24442ab
commit 56e0fe562d
36 changed files with 1342 additions and 186 deletions

View File

@@ -43,7 +43,7 @@ test('normalizeTestCase keeps existing categoryId', () => {
assert.equal(tc.categoryId, 'cat-test-api');
});
test('normalizeTestCase backfills missing estimateHours', () => {
test('normalizeTestCase keeps missing executor estimate empty', () => {
const tc = normalizeTestCase({
id: 'tc-1',
caseNo: 'TC-001',
@@ -57,8 +57,45 @@ test('normalizeTestCase backfills missing estimateHours', () => {
updatedAt: '2026-06-25',
} as any);
assert.equal(tc.estimateHours, 0.5);
assert.equal(getTestCaseEstimateHours(tc), 0.5);
assert.equal(tc.estimateHours, undefined);
assert.equal(getTestCaseEstimateHours(tc), 0);
});
test('getTestCaseEstimateHours prefers executor estimate over AI estimate', () => {
const tc = normalizeTestCase({
id: 'tc-1',
caseNo: 'TC-001',
versionId: 'v1',
title: '登录正常',
priority: 'P2',
status: 'pending',
categoryId: 'cat-test-api',
estimateHours: 0.7,
aiEstimateHours: 0.2,
createdBy: 'tester',
createdAt: '2026-06-25',
updatedAt: '2026-06-25',
} as any);
assert.equal(getTestCaseEstimateHours(tc), 0.7);
});
test('getTestCaseEstimateHours falls back to AI estimate', () => {
const tc = normalizeTestCase({
id: 'tc-1',
caseNo: 'TC-001',
versionId: 'v1',
title: '登录正常',
priority: 'P2',
status: 'pending',
categoryId: 'cat-test-api',
aiEstimateHours: 0.2,
createdBy: 'tester',
createdAt: '2026-06-25',
updatedAt: '2026-06-25',
} as any);
assert.equal(getTestCaseEstimateHours(tc), 0.2);
});
test('test case status labels use waiting and testing wording', () => {