feat(版本): 优化概览与只读状态
关键改动: - 增加需求排序和版本只读状态规则及测试 - 完善版本概览阶段耗时、项目页和工作台展示 - 优化小宝预警请求节流、建议状态和风险过滤 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
25
apps/web/lib/version-status.test.ts
Normal file
25
apps/web/lib/version-status.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user