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

@@ -0,0 +1,33 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import type { DevTask } from './dev-task';
import { needsDelayReason } from './dev-task-transitions';
function task(patch: Partial<DevTask> = {}): DevTask {
return {
id: 'task-1',
taskNo: 'DEV-001',
requirementId: 'req-1',
title: '实现排班规则',
categoryId: 'cat-frontend-interaction',
assigneeId: 'Alice',
priority: 'P2',
expectedStartAt: '2026-06-29T01:00:00.000Z',
expectedEndAt: '2026-06-29T10:00:00.000Z',
status: 'todo',
isBlocked: false,
createdBy: 'PM',
createdAt: '2026-06-29T00:00:00.000Z',
updatedAt: '2026-06-29T00:00:00.000Z',
...patch,
};
}
test('needsDelayReason does not require a reason before expected end time', () => {
assert.equal(needsDelayReason(task(), new Date('2026-06-29T09:00:00.000Z')), false);
});
test('needsDelayReason requires a reason after expected end time for todo tasks', () => {
assert.equal(needsDelayReason(task(), new Date('2026-06-29T10:01:00.000Z')), true);
});