Files
admin-web/src/modules/container-loading/pages/ContainerDetailView.test.ts
T

41 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-08-18 17:40:40 +08:00
import { describe, expect, it } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/ContainerDetailView.vue'), 'utf8')
describe('ContainerDetailView', () => {
it('keeps identity, status and key facts in a compact overview', () => {
expect(source).toContain('class="container-overview surface-panel"')
expect(source).toContain('class="container-overview__header"')
expect(source).toContain('class="container-overview__summary"')
expect(source).toContain('grid-template-columns:repeat(5,minmax(0,1fr))')
})
it('keeps real document, exception and authorized photo operations', () => {
expect(source).toContain('uploadContainerDocument(')
expect(source).toContain('downloadContainerDocument(')
expect(source).toContain('uploadContainerClearance(')
expect(source).toContain('completeContainerClearance(')
expect(source).toContain('markContainerException')
expect(source).toContain('cancelContainerException')
expect(source).toContain('downloadContainerPdaPhoto(photo.downloadPath)')
})
2026-08-19 16:45:51 +08:00
it('carries the existing read-only CarrierScheduleQuery by booking and container', () => {
expect(source).toContain('CarrierScheduleQueryPanel')
expect(source).toContain("from '@/modules/port-schedules'")
expect(source).toContain(':ocean-booking-id="detail.oceanBookingId"')
expect(source).toContain(':container-booking-id="detail.id"')
})
2026-08-20 18:02:52 +08:00
it('shows overseas unloading and empty-report facts without adding upload or PDA actions', () => {
expect(source).toContain('detail.unloadingCompletedAt')
expect(source).toContain('detail.unloadingPhotoUploadedAt')
expect(source).toContain('detail.estimatedEmptyReportedAt')
expect(source).toContain('detail.actualEmptyReportedAt')
expect(source).not.toContain('uploadUnloadingPhoto')
expect(source).not.toContain('submitEmptyReport')
})
2026-08-18 17:40:40 +08:00
})