This commit is contained in:
2026-09-09 17:58:23 +08:00
parent 2fd9c5fcc7
commit ae01e066ca
4 changed files with 112 additions and 7 deletions
@@ -7,10 +7,14 @@ const source = readFileSync(resolve(process.cwd(), 'src/modules/unified-orders/p
const routeSource = readFileSync(resolve(process.cwd(), 'src/modules/unified-orders/routes.ts'), 'utf8').replace(/\r\n/g, '\n')
describe('UnifiedOrdersView contract', () => {
it('shows the server confirmation lock without reading a stale fee snapshot', () => {
it('loads the reference unit price while rechecking the confirmation lock before sending', () => {
const openDialogSource = source.slice(source.indexOf('async function openFeeConfirmDialog()'), source.indexOf('async function executeConfirmAndSendFee()'))
const sendFeeSource = source.slice(source.indexOf('async function executeConfirmAndSendFee()'), source.indexOf('function handleOrderSelectionChange'))
expect(openDialogSource).not.toContain('getLatestInboundFee')
expect(openDialogSource).toContain('getLatestInboundFee')
expect(sendFeeSource).toContain('getLatestInboundFee')
expect(sendFeeSource).toContain('adjustPublishedInboundFee')
expect(source).toContain('价格表参考单价')
expect(source).toContain('本次对客单价')
expect(sendFeeSource).toContain("ElMessage.error(getApiErrorDetails(error, '确认费用发送失败').message)")
})
@@ -443,7 +447,7 @@ describe('UnifiedOrdersView contract', () => {
const sendFeeSource = source.slice(source.indexOf('async function executeConfirmAndSendFee()'), source.indexOf('function handleOrderSelectionChange'))
expect(sendFeeSource).not.toContain('saveInboundMeasurementDraft')
expect(sendFeeSource).not.toContain('updateMeasurementCalculationMode')
expect(source.slice(source.indexOf('async function openFeeConfirmDialog()'), source.indexOf('async function executeConfirmAndSendFee()'))).not.toContain('getLatestInboundFee')
expect(source.slice(source.indexOf('async function openFeeConfirmDialog()'), source.indexOf('async function executeConfirmAndSendFee()'))).toContain('getLatestInboundFee')
})
it('clears an invalidated measurement loading state before refreshing order details', () => {