feat(consignment): 自动匹配改为发布前即时匹配,manual 保留内部等待
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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('自动匹配:手动等待与超时策略在 auto 下禁用并给出说明', () => {
|
||||
const source = readPanelSource()
|
||||
assert.ok(source.includes('label="手动匹配等待(分钟)"'), '等待时长文案必须明确只作用于手动匹配')
|
||||
assert.ok(source.includes('label="超时后回大厅"'), '必须提供超时回大厅开关')
|
||||
assert.ok(
|
||||
source.includes('自动匹配在发布时立即匹配,未命中直接进大厅,不使用等待窗口'),
|
||||
'auto 模式必须说明不使用等待窗口',
|
||||
)
|
||||
assert.ok(
|
||||
source.includes('关闭后超时重新匹配(最多 3 次),仍未命中回大厅'),
|
||||
'关闭回大厅时必须说明重试上限',
|
||||
)
|
||||
assert.ok(
|
||||
(source.match(/disabled=\{matchingMode === 'auto'\}/g) || []).length >= 2,
|
||||
'等待时长与超时策略在 auto 下都必须禁用',
|
||||
)
|
||||
assert.ok(!source.includes('label="内部匹配等待(分钟)"'), '旧文案必须移除')
|
||||
})
|
||||
@@ -35,7 +35,7 @@ test('寄卖配置面板:必须覆盖保证金/服务费/数量限制/匹配/
|
||||
'开启单人寄售上限',
|
||||
'匹配模式',
|
||||
'关闭匹配',
|
||||
'内部匹配等待(分钟)',
|
||||
'手动匹配等待(分钟)',
|
||||
'代练超时(小时)',
|
||||
'重新匹配并退还押金',
|
||||
'开启降价提示',
|
||||
|
||||
Reference in New Issue
Block a user