This commit is contained in:
2026-08-04 21:01:39 +08:00
parent 88bd939170
commit 5cb1ca307d
77 changed files with 9914 additions and 131 deletions
@@ -0,0 +1,61 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'
const source = readFileSync(resolve(process.cwd(), 'src/modules/inbounds/components/InboundWorkflowWorkspace.vue'), 'utf8')
describe('InboundWorkflowWorkspace', () => {
it('assembles every phase-two inbound domain behind one server-backed workspace', () => {
expect(source).toContain('InboundSummaryPanel')
expect(source).toContain('InboundHistoryPanel')
expect(source).toContain('InboundMeasurementPanel')
expect(source).toContain('WeightOcrPanel')
expect(source).toContain('MeasurementReviewPanel')
expect(source).toContain('InboundFeePanel')
expect(source).toContain('getPlatformInbound')
expect(source).toContain('StatusBadge')
expect(source).toContain('label="基本信息"')
expect(source).toContain('label="货物与测量"')
expect(source).toContain('label="测量审核"')
expect(source).toContain('label="费用快照"')
expect(source).toContain('label="托盘与记录"')
})
it('uses the established first-leg detail density without nested framed surfaces', () => {
expect(source).toContain('padding: 20px 24px')
expect(source).toContain('border-bottom: 1px solid var(--cc-border)')
expect(source).not.toContain('border-radius: 10px')
expect(source).not.toContain('<el-tag')
})
it('refreshes the aggregate and remounts domains after manual or child refresh', () => {
expect(source).toContain('function handleDomainChanged()')
expect(source).toContain('async function refreshWorkspace()')
expect(source).toContain('revision.value += 1')
expect(source).toContain('void refreshWorkspace()')
expect(source).toContain('@click="refreshWorkspace"')
expect(source).toContain('@changed="handleDomainChanged"')
})
it('uses customer context in the page layer and maps it to compatible domain APIs', () => {
expect(source).toContain('customerId: string')
expect(source).toContain('getPlatformInbound(props.customerId, props.inboundId)')
expect(source).toContain(':tenant-id="customerId"')
expect(source).toContain('缺少所属企业信息')
expect(source).not.toContain('请选择企业')
expect(source).not.toContain('租户')
})
it('does not mount the review domain without its required measurement data permission', () => {
expect(source).toContain("access.can('platform:firstleg:inbound:measure:view')")
expect(source).toContain('v-if="canViewMeasurement"')
expect(source).toContain('无测量审核查看权限')
})
it('keeps pallet and location results read-only in the overview', () => {
expect(source).toContain(':pallet-locations="detail.palletLocations"')
expect(source).toContain('label="托盘与记录"')
expect(source).not.toContain('reserveLocation')
expect(source).not.toContain('allocatePallet')
})
})