关键改动: - 增加需求排序和版本只读状态规则及测试 - 完善版本概览阶段耗时、项目页和工作台展示 - 优化小宝预警请求节流、建议状态和风险过滤 Co-Authored-By: Codex GPT-5 <codex@openai.com>
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { getVersionReadonlyNotice, isVersionReadonly } from './version-status';
|
|
|
|
test('isVersionReadonly locks released closed and paused versions', () => {
|
|
assert.equal(isVersionReadonly('released'), true);
|
|
assert.equal(isVersionReadonly('closed'), true);
|
|
assert.equal(isVersionReadonly('paused'), true);
|
|
});
|
|
|
|
test('isVersionReadonly allows planned and developing versions to be edited', () => {
|
|
assert.equal(isVersionReadonly('planned'), false);
|
|
assert.equal(isVersionReadonly('developing'), false);
|
|
});
|
|
|
|
test('getVersionReadonlyNotice explains locked version task actions', () => {
|
|
assert.equal(getVersionReadonlyNotice('released'), '已发布版本不可编辑或删除任务');
|
|
assert.equal(getVersionReadonlyNotice('paused'), '已暂停版本不可编辑或删除任务');
|
|
assert.equal(getVersionReadonlyNotice('closed'), '已关闭版本不可编辑或删除任务');
|
|
});
|
|
|
|
test('getVersionReadonlyNotice stays empty for editable versions', () => {
|
|
assert.equal(getVersionReadonlyNotice('developing'), null);
|
|
assert.equal(getVersionReadonlyNotice('planned'), null);
|
|
});
|