feat(consignment): 寄售仓库新增对接客服多选筛选
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import test from 'node:test'
|
||||
|
||||
const source = readFileSync(
|
||||
join(
|
||||
dirname(fileURLToPath(import.meta.url)),
|
||||
'../src/pages/admin/panels/ConsignmentInventoryPanel.tsx',
|
||||
),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
test('寄售仓库提供对接客服多选筛选,并与未指定取并集', () => {
|
||||
assert.ok(source.includes('mode="multiple"'))
|
||||
assert.ok(source.includes('placeholder="对接客服(可多选)"'))
|
||||
assert.ok(source.includes('optionFilterProp="label"'))
|
||||
assert.ok(source.includes('contactSupporterIdsParam'))
|
||||
assert.ok(source.includes('contactSupporterIds: contactSupporterIdsParam'))
|
||||
assert.ok(
|
||||
source.includes('contactSupporterUnassigned: includeUnassignedContactSupporter || undefined'),
|
||||
)
|
||||
assert.ok(source.includes("{ label: '未指定', value: 0 }"))
|
||||
// 对接客服筛选必须排在搜索框前面。
|
||||
const contactIndex = source.indexOf('placeholder="对接客服(可多选)"')
|
||||
const searchIndex = source.indexOf('placeholder="搜索物品名/编号/收购人/店铺/卖家"')
|
||||
assert.ok(contactIndex > 0 && searchIndex > 0 && contactIndex < searchIndex)
|
||||
})
|
||||
|
||||
test('对接客服筛选进入列表 queryKey,统计卡片不跟随', () => {
|
||||
assert.ok(source.includes('includeUnassignedContactSupporter,'))
|
||||
const statsStart = source.indexOf("'admin-consignment-stats'")
|
||||
assert.ok(statsStart > 0, '未找到寄售统计查询')
|
||||
const statsBlock = source.slice(statsStart, statsStart + 600)
|
||||
assert.ok(
|
||||
!statsBlock.includes('contactSupporterIdsParam'),
|
||||
'统计卡片不应跟随对接客服筛选,保持原有统计口径',
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user