关键改动: - 后端显式注册 10mb JSON/urlencoded body parser,支持较大的 AppData 写入 - 前端版本派生数据缺失状态时默认 planned,而不是 released - 增加请求体限制和版本默认状态测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
33 lines
816 B
TypeScript
33 lines
816 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { flattenProjects, flattenVersions } from './derive';
|
|
|
|
const overview = [{
|
|
id: 'product-1',
|
|
name: 'Product',
|
|
projects: [{
|
|
id: 'project-1',
|
|
name: 'Project',
|
|
description: '',
|
|
createdAt: '2026-07-02T00:00:00.000Z',
|
|
}],
|
|
versions: [{
|
|
id: 'version-1',
|
|
name: 'ProjectV1.0',
|
|
releaseDate: null,
|
|
createdAt: '2026-07-02T00:00:00.000Z',
|
|
}],
|
|
}];
|
|
|
|
test('flattenVersions defaults missing version status to planned', () => {
|
|
const [version] = flattenVersions(overview);
|
|
|
|
assert.equal(version.status, 'planned');
|
|
});
|
|
|
|
test('flattenProjects defaults nested missing version status to planned', () => {
|
|
const [project] = flattenProjects(overview);
|
|
|
|
assert.equal(project.versions[0].status, 'planned');
|
|
});
|