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="内部匹配等待(分钟)"'), '旧文案必须移除') })