This commit is contained in:
2026-10-12 13:43:21 +08:00
parent 92bdd32f86
commit 3f6d74dee1
10 changed files with 131 additions and 166 deletions
@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest'
import { returnRelabelStatusLabel } from './returnRelabelProgress'
describe('退货箱换标状态', () => {
it('申请绑定不表示完成,部分和全部完成分别显示', () => {
expect(returnRelabelStatusLabel('BOUND')).toBe('处理中')
expect(returnRelabelStatusLabel('PROCESSING')).toBe('处理中')
expect(returnRelabelStatusLabel('PARTIALLY_COMPLETED')).toBe('部分完成')
expect(returnRelabelStatusLabel('COMPLETED')).toBe('全部完成')
expect(returnRelabelStatusLabel()).toBe('—')
expect(returnRelabelStatusLabel('UNLABELLED')).toBe('未换标')
expect(returnRelabelStatusLabel('UNKNOWN')).toBe('—')
})
})
@@ -0,0 +1,7 @@
export function returnRelabelStatusLabel(status?: string) {
const labels: Record<string, string> = {
UNLABELLED: '未换标', BOUND: '处理中', PROCESSING: '处理中',
PARTIALLY_COMPLETED: '部分完成', COMPLETED: '全部完成',
}
return status ? labels[status] || '—' : '—'
}