2026-08-04 21:01:39 +08:00
|
|
|
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="测量审核"')
|
2026-08-06 13:56:04 +08:00
|
|
|
expect(source).toContain('label="费用信息"')
|
|
|
|
|
expect(source).toContain('label="状态与其他"')
|
2026-08-04 21:01:39 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
it('uses the established first-leg detail density without nested framed surfaces', () => {
|
2026-08-06 13:56:04 +08:00
|
|
|
expect(source).toContain('padding: 18px 24px 16px')
|
2026-08-04 21:01:39 +08:00
|
|
|
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"')
|
2026-08-06 13:56:04 +08:00
|
|
|
expect(source).toContain('label="状态与其他"')
|
2026-08-04 21:01:39 +08:00
|
|
|
expect(source).not.toContain('reserveLocation')
|
|
|
|
|
expect(source).not.toContain('allocatePallet')
|
|
|
|
|
})
|
|
|
|
|
})
|