This commit is contained in:
2026-08-28 16:54:02 +08:00
parent 94f003153d
commit 813763a02a
16 changed files with 413 additions and 883 deletions
@@ -0,0 +1,32 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'
const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/components/ContainerCustomsPanel.vue'), 'utf8')
describe('ContainerCustomsPanel contract', () => {
it('renders compact coverage, missing inbound and frozen document facts with operation first', () => {
expect(source).toContain('退税总票')
expect(source).toContain('缺资料清单')
expect(source).toContain('<th>操作</th><th>关联入仓码</th><th>版本</th><th>客户</th>')
expect(source).toContain("item.taxMode === 'TAX_REFUND' && !item.covered")
})
it('gates start by server status and confirms frozen facts', () => {
expect(source).toContain("customs.status === 'READY_TO_START'")
expect(source).toContain('冻结客户当前资料版本、关联入仓码覆盖范围及平台买单准备事实')
})
it('requires a second confirmation for the final missing completion and keeps departure independent', () => {
expect(source).toContain('missingCompletionCount.value === 1')
expect(source).toContain('确认上传并完成')
expect(source).toContain("departureState === 'DEPARTED' ? '已自动离仓' : '报关已完成,待其他离仓条件'")
})
it('creates the all-buy XLSX task with loadingPlanId as its only parameter', () => {
expect(source).toContain("exportType: 'LOADING_LIST_BUY_DECLARATION_ITEMS', format: 'XLSX'")
expect(source).toContain('parameters: { loadingPlanId: String(props.loadingPlanId) }')
expect(source).not.toContain('fileType')
expect(source).not.toContain('documentType')
})
})