Files
order_site/apps/frontend/tests/consignment-auto-match-publish.test.ts
T
zhaoxing 8920afa0e5 feat(consignment): 拼单一次拼满,内部匹配到期统一回大厅
- 拼单(自动/手动)先规划再一次落库,凑不齐整单失败并回滚,不再进入 internal_matching

- 删除「超时后回大厅」开关与 fallbackToHall 配置,到期统一回大厅(迁移 152 清理历史字段)
2026-11-07 14:27:34 +08:00

25 lines
1.2 KiB
TypeScript

import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import test from 'node:test'
function readPanelSource() {
return readFileSync(
fileURLToPath(new URL('../src/pages/admin/panels/ConsignmentConfigPanel.tsx', import.meta.url)),
'utf8',
).replace(/\r\n/g, '\n')
}
test('手动匹配:只保留等待时长,不再提供「超时后回大厅」开关', () => {
const source = readPanelSource()
assert.ok(source.includes('label="手动匹配等待(分钟)"'), '等待时长文案必须明确只作用于手动匹配')
assert.ok(source.includes("matchingMode === 'manual' ? ("), '等待时长必须只在手动匹配下展示')
assert.ok(!source.includes('超时后回大厅'), '回大厅是固定行为,不应再有开关')
assert.ok(!source.includes('fallbackToHall'), '配置与表单必须移除 fallbackToHall')
assert.ok(
source.includes('自动匹配:发布/补资料时立即匹配,未命中直接进大厅,不使用内部等待窗口。'),
'auto 模式必须说明不使用等待窗口',
)
assert.ok(!source.includes('label="内部匹配等待(分钟)"'), '旧文案必须移除')
})