fix(bug):1.帮我检查一下平台中有多少处显示部门地方这种“e10-、、、、”字样拿掉不要显示
deploy-hxtesting / build-and-deploy (push) Successful in 1m28s
deploy-hxtesting / build-and-deploy (push) Successful in 1m28s
2.月培训计划发布时授课时间默认空着点击【发布】时提示先维护授课时间,(不要默认年培训计划) 3.授课地点默认“年度计划”所设置的授课地点,如果年培训计划没有维护发布时也要必填 4.点击【发布】时要校验参加人员不能为空!默认为所属部门下的人员~ 认真阅读相关代码~
This commit is contained in:
1 parent
6cdcc4f221
commit
858c352991
16 files changed
+421
-89
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { test } from 'node:test'
|
||||
import { cleanDeptName, cleanDeptNameText, displayDeptName, filterVisibleDepts, isSyntheticDeptName } from './deptName'
|
||||
|
||||
test('cleanDeptName strips e10-<id> tokens and trims', () => {
|
||||
assert.equal(cleanDeptName('e10-1115765553620631553'), '')
|
||||
assert.equal(cleanDeptName('研发技术课'), '研发技术课')
|
||||
assert.equal(cleanDeptName('研发组 e10-1172161210096713736'), '研发组')
|
||||
assert.equal(cleanDeptName('e10-111 e10-222 研发组'), '研发组')
|
||||
assert.equal(cleanDeptName(' E10-1172161210096713736 '), '')
|
||||
assert.equal(cleanDeptName(null), '')
|
||||
assert.equal(cleanDeptName(undefined), '')
|
||||
})
|
||||
|
||||
test('isSyntheticDeptName detects nameless synced depts', () => {
|
||||
assert.equal(isSyntheticDeptName('e10-1115765553620631553'), true)
|
||||
assert.equal(isSyntheticDeptName('模具课'), false)
|
||||
assert.equal(isSyntheticDeptName(''), true)
|
||||
assert.equal(isSyntheticDeptName(null), true)
|
||||
})
|
||||
|
||||
test('displayDeptName returns displayable text', () => {
|
||||
assert.equal(displayDeptName('e10-1172161210096713736'), '')
|
||||
assert.equal(displayDeptName('资讯组'), '资讯组')
|
||||
})
|
||||
|
||||
test('filterVisibleDepts drops synthetic-only depts', () => {
|
||||
const depts = [
|
||||
{ id: '1', name: '研发技术课' },
|
||||
{ id: '2', name: 'e10-1115765553620631553' },
|
||||
{ id: '3', name: '模具课' },
|
||||
{ id: '4', name: '' },
|
||||
]
|
||||
assert.deepEqual(filterVisibleDepts(depts), [
|
||||
{ id: '1', name: '研发技术课' },
|
||||
{ id: '3', name: '模具课' },
|
||||
])
|
||||
assert.deepEqual(filterVisibleDepts(null), [])
|
||||
})
|
||||
|
||||
test('cleanDeptNameText strips tokens inside free text without dangling separators', () => {
|
||||
assert.equal(cleanDeptNameText('e10-1115765553620631553、研发组'), '研发组')
|
||||
assert.equal(cleanDeptNameText('研发组、e10-1172161210096713736、模具课'), '研发组、模具课')
|
||||
assert.equal(cleanDeptNameText('资讯组'), '资讯组')
|
||||
assert.equal(cleanDeptNameText('e10-111,e10-222'), '')
|
||||
assert.equal(cleanDeptNameText(null), '')
|
||||
})
|
||||
Reference in new issue
Block a user