feat(AI): 增加严格估时策略
This commit is contained in:
25
apps/web/lib/ai-estimation-policy.test.ts
Normal file
25
apps/web/lib/ai-estimation-policy.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
clampDevEstimateHours,
|
||||
clampTestCaseEstimateHours,
|
||||
getDefaultTestCaseEstimateHours,
|
||||
} 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);
|
||||
});
|
||||
|
||||
test('keeps backend API within strict range', () => {
|
||||
assert.equal(clampDevEstimateHours('backend_api', 0.25), 0.75);
|
||||
assert.equal(clampDevEstimateHours('backend_api', 2), 1.5);
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user