34 lines
886 B
TypeScript
34 lines
886 B
TypeScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
|
|
import {
|
|
getInventoryPublicAssetLabel,
|
|
isInventoryPublicAssetPerson
|
|
} from '../src/views/inventory/inventoryPublicAsset.ts'
|
|
|
|
test('isInventoryPublicAssetPerson 应识别公共资产保留人员', () => {
|
|
assert.equal(
|
|
isInventoryPublicAssetPerson({
|
|
person_source_userid: '__public_asset__',
|
|
person_nickname: '公共资产',
|
|
person_name: '公共资产'
|
|
}),
|
|
true
|
|
)
|
|
})
|
|
|
|
test('isInventoryPublicAssetPerson 不应把普通人员误判为公共资产', () => {
|
|
assert.equal(
|
|
isInventoryPublicAssetPerson({
|
|
person_source_userid: 'ding_001',
|
|
person_nickname: '三藏',
|
|
person_name: '张三'
|
|
}),
|
|
false
|
|
)
|
|
})
|
|
|
|
test('getInventoryPublicAssetLabel 应返回系统保留标签文案', () => {
|
|
assert.equal(getInventoryPublicAssetLabel(), '系统保留')
|
|
})
|