35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|||
|
|
import { readFileSync } from 'node:fs'
|
||
|
|
import { resolve } from 'node:path'
|
||
|
|
|
||
|
|
const source = readFileSync(resolve(process.cwd(), 'src/modules/trucking/components/TruckAppointmentForm.vue'), 'utf8')
|
||
|
|
|
||
|
|
describe('TruckAppointmentForm interaction contract', () => {
|
||
|
|
it('uses searchable business selectors for shared resources', () => {
|
||
|
|
expect(source).toContain('listPlatformTenants')
|
||
|
|
expect(source).toContain('listPlatformPartners')
|
||
|
|
expect(source).toContain('listContainers')
|
||
|
|
expect(source).toContain('listOceanBookings')
|
||
|
|
expect(source).toContain('listAllPlatformWarehouses')
|
||
|
|
expect(source).not.toContain('label="承运商 ID"')
|
||
|
|
expect(source).not.toContain('label="客户关联 ID"')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('synchronizes ids and names and recovers failed option loading', () => {
|
||
|
|
expect(source).toContain('selectCarrier')
|
||
|
|
expect(source).toContain('draft.carrierName')
|
||
|
|
expect(source).toContain('selectCustomer')
|
||
|
|
expect(source).toContain('draft.customerName')
|
||
|
|
expect(source).toContain('selectContainer')
|
||
|
|
expect(source).toContain('draft.loadingPlanId = item.planId')
|
||
|
|
expect(source).toContain('重新加载选项')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('gives editable fields clear placeholders', () => {
|
||
|
|
expect(source).toContain('placeholder="请输入司机姓名"')
|
||
|
|
expect(source).toContain('placeholder="请选择预计装箱时间"')
|
||
|
|
expect(source).toContain('placeholder="请输入目的门店地址"')
|
||
|
|
expect(source).toContain('placeholder="请输入拖车预约备注(可选)"')
|
||
|
|
})
|
||
|
|
})
|