feat(ai): 优化拆解重跑与结果展示
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user