feat(ai): 优化拆解重跑与结果展示
This commit is contained in:
@@ -2,24 +2,25 @@ import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
clampDevEstimateHours,
|
||||
clampTestCaseEstimateHours,
|
||||
getDefaultTestCaseEstimateHours,
|
||||
clampDevAiEstimateHours,
|
||||
clampTestCaseAiEstimateHours,
|
||||
getDefaultTestCaseAiEstimateHours,
|
||||
} from './ai-estimation-policy';
|
||||
|
||||
test('clamps simple frontend interaction to AI-assisted range', () => {
|
||||
assert.equal(clampDevEstimateHours('frontend_interaction', 5), 1);
|
||||
assert.equal(clampDevEstimateHours('frontend_interaction', 0.1), 0.5);
|
||||
assert.equal(clampDevAiEstimateHours('frontend_interaction', 5), 0.5);
|
||||
assert.equal(clampDevAiEstimateHours('frontend_interaction', 0.1), 0.25);
|
||||
});
|
||||
|
||||
test('keeps backend API within strict range', () => {
|
||||
assert.equal(clampDevEstimateHours('backend_api', 0.25), 0.75);
|
||||
assert.equal(clampDevEstimateHours('backend_api', 2), 1.5);
|
||||
assert.equal(clampDevAiEstimateHours('backend_api', 0.25), 0.5);
|
||||
assert.equal(clampDevAiEstimateHours('backend_api', 2), 1);
|
||||
});
|
||||
|
||||
test('defaults and clamps test case estimates', () => {
|
||||
assert.equal(getDefaultTestCaseEstimateHours('test_functional'), 0.5);
|
||||
assert.equal(clampTestCaseEstimateHours('test_functional', 2), 0.5);
|
||||
assert.equal(clampTestCaseEstimateHours('test_api', 0.25), 0.5);
|
||||
assert.equal(clampTestCaseEstimateHours('test_exception', 2), 1);
|
||||
test('defaults and clamps test case AI estimates below half an hour when appropriate', () => {
|
||||
assert.equal(getDefaultTestCaseAiEstimateHours('test_functional'), 0.2);
|
||||
assert.equal(clampTestCaseAiEstimateHours('test_functional', 2), 0.3);
|
||||
assert.equal(clampTestCaseAiEstimateHours('test_functional', 0.05), 0.1);
|
||||
assert.equal(clampTestCaseAiEstimateHours('test_api', 0.1), 0.2);
|
||||
assert.equal(clampTestCaseAiEstimateHours('test_exception', 2), 0.5);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user