✨ feat(frontend): 新增上传中断并联动历史回收状态
This commit is contained in:
1 parent
a962f7aec7
commit
e7918e9317
20 files changed
+275
-71
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import {test} from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import {getHistoryStatusLabel} from '../src/utils/history-status.ts'
|
||||
test('history labels follow trash and purge before expiry/current flags',()=>{
|
||||
for(const [value,want] of [[{current:true},'现存'],[{status:'trashed',current:false,expired:true},'回收站中'],[{status:'purged',deleted:true},'已清理'],[{status:'active',current:true},'现存'],[{status:'expired',current:true},'现存'],[{deleted:true,current:false},'已删除'],[{current:false},'历史']])assert.equal(getHistoryStatusLabel(value),want)
|
||||
})
|
||||
|
||||
test('restored history is distinct and recoverable reasons match trash labels',()=>{
|
||||
assert.equal(getHistoryStatusLabel({status:'active',current:true,was_restored:true}),'现存,已从回收站恢复')
|
||||
assert.equal(getHistoryStatusLabel({status:'trashed',trash_reason:'expired_count'}),'次数用尽')
|
||||
assert.equal(getHistoryStatusLabel({status:'trashed',trash_reason:'expired_time'}),'保存到期')
|
||||
assert.equal(getHistoryStatusLabel({status:'trashed',trash_reason:'manual'}),'手动删除')
|
||||
})
|
||||
Reference in new issue
Block a user