Files
admin-web/src/modules/trucking/components/TruckAttachmentDialog.test.ts
T

22 lines
955 B
TypeScript
Raw Normal View History

2026-08-11 19:59:15 +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/trucking/components/TruckAttachmentDialog.vue'), 'utf8')
describe('TruckAttachmentDialog interaction governance', () => {
it('shows existing attachments without exposing file-service internals', () => {
expect(source).toContain('预约附件')
expect(source).toContain('attachmentTypeLabel(item.attachmentType)')
expect(source).not.toContain('文件 ID')
expect(source).not.toContain('item.objectKey')
})
it('hides the unavailable manual reference flow but keeps deletion', () => {
expect(source).not.toContain('referenceTruckAppointmentAttachment')
expect(source).not.toContain('输入文件服务 ID')
expect(source).toContain('deleteTruckAppointmentAttachment')
expect(source).toContain('<Trash2 :size="15" />删除')
})
})