feat(版本详情): 接入计划时间与日期选择

This commit is contained in:
Script Generator
2026-06-29 14:18:58 +08:00
parent dde11c0899
commit 0f64a17d44
20 changed files with 601 additions and 12 deletions

View File

@@ -48,6 +48,24 @@ test('normalizeTestCase keeps existing categoryId', () => {
assert.equal(tc.categoryId, 'cat-test-api');
});
test('normalizeTestCase preserves planned test time', () => {
const tc = normalizeTestCase({
id: 'tc-1',
caseNo: 'TC-001',
versionId: 'v1',
title: 'scheduled test case',
priority: 'P2',
status: 'pending',
categoryId: 'cat-test-api',
plannedTestAt: '2026-07-01T09:30:00.000Z',
createdBy: 'tester',
createdAt: '2026-06-25',
updatedAt: '2026-06-25',
} as any);
assert.equal(tc.plannedTestAt, '2026-07-01T09:30:00.000Z');
});
test('normalizeTestCase backfills missing roundNo to the first test round', () => {
const tc = normalizeTestCase({
id: 'tc-1',
@@ -116,6 +134,7 @@ test('copyTestCaseToRound preserves estimates and references but clears executio
categoryId: 'cat-test-functional',
estimateHours: 0.75,
aiEstimateHours: 0.25,
plannedTestAt: '2026-07-01T09:30:00.000Z',
assigneeId: 'QA',
startedAt: '2026-06-25T01:00:00.000Z',
completedAt: '2026-06-25T02:00:00.000Z',
@@ -137,6 +156,7 @@ test('copyTestCaseToRound preserves estimates and references but clears executio
assert.equal(copied.sourceCaseId, 'tc-source');
assert.equal(copied.aiEstimateHours, 0.25);
assert.equal(copied.estimateHours, 0.75);
assert.equal(copied.plannedTestAt, '2026-07-01T09:30:00.000Z');
assert.deepEqual(copied.references, source.references);
assert.equal(copied.startedAt, undefined);
assert.equal(copied.completedAt, undefined);