import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import test from 'node:test' const view = readFileSync(new URL('./WarehouseServiceView.vue', import.meta.url), 'utf8') const api = readFileSync(new URL('../api/warehouseServices.ts', import.meta.url), 'utf8') test('上传关联面单后直接生成箱维度货物明细', () => { assert.match(view, /下载关联模板/) assert.match(view, /上传关联面单/) assert.match(view, /cargoRows\.value = imported\.map/) assert.match(view, /totalPackageCount: 1, notifiedPackageCount: 1/) assert.doesNotMatch(view, /applyCartonMarkBinding/) assert.doesNotMatch(view, /上传SKU 标签/) }) test('目的仓支持顶部兜底并随每箱明细提交', () => { assert.match(api, /destinationWarehouseId\?: string/) assert.match(view, /!item\.destinationWarehouseId && !form\.warehouse/) assert.match(view, /destinationWarehouseId: item\.destinationWarehouseId \|\| undefined/) assert.match(view, /cartonMark: item\.cartonMark/) assert.match(view, /fbaCartonMark: item\.fbaCartonMark/) }) test('贴标明细保留箱唛绑定,不再单独填箱数', () => { assert.match(view, /