test(admin): harden booking document workflows

This commit is contained in:
2026-08-31 21:05:03 +08:00
parent 623dfce255
commit 49babd731a
5 changed files with 79 additions and 28 deletions
@@ -92,7 +92,7 @@ describe('OceanBookingDetailView draft and release contract', () => {
expect(source).toContain('当前船公司暂无可用订舱代理')
expect(source).toContain(':label="supplier.name"')
expect(source).toContain('filterable clearable')
expect(source).toContain(':disabled="!editable || !form.data.warehouseId || channelsLoading || !!channelsError || channelUnavailable"')
expect(source).toContain(':disabled="!formWritable || !form.data.warehouseId || channelsLoading || !!channelsError || channelUnavailable"')
expect(source).toContain(':disabled="!editable || !form.data.carrierCode || bookingAgentsLoading || !!bookingAgentsError"')
})
@@ -115,6 +115,13 @@ describe('OceanBookingDetailView draft and release contract', () => {
expect(source).toContain('打印单据')
})
it('keeps a DRAFT detail read-only when the user lacks write permission', () => {
expect(source).toContain('const formWritable = computed(() => canSave.value)')
expect(source).toContain(':disabled="!formWritable" class="booking-groups"')
expect(source).toContain('v-if="formWritable" class="container-actions"')
expect(source).toContain(':disabled="!formWritable"')
})
it('carries the existing read-only CarrierScheduleQuery on the booking detail page', () => {
expect(source).toContain('CarrierScheduleQueryPanel')
expect(source).toContain("from '@/modules/port-schedules'")