This commit is contained in:
2026-08-26 14:48:48 +08:00
parent 5daaf1a5fa
commit 2563ad7be3
7 changed files with 34 additions and 8 deletions
@@ -48,6 +48,16 @@ describe('supplier formal pages', () => {
expect(detailSource).toContain('<ApiErrorMeta')
})
it('uses a fixed carrier-code selector for booking suppliers and shows the code in list and detail', () => {
expect(formSource).toContain('v-if="form.category === \'BOOKING\'"')
expect(formSource).toContain('v-for="option in carrierCodeOptions"')
expect(formSource).not.toContain('v-model="form.carrierCode" maxlength')
expect(formSource).toContain("if (category !== 'BOOKING') form.carrierCode = null")
expect(formSource).toContain("return form.category === 'BOOKING' ? { ...normalized, carrierCode } : normalized")
expect(source).toContain("label: '船司标准编码'")
expect(detailSource).toContain("['船司标准编码', formatCarrierCode(supplier.value.carrierCode)]")
})
it('reloads detail data when the reused route id changes and protects the newer request', () => {
expect(detailSource).toContain("watch(supplierId, () => { void load() }, { immediate: true })")
expect(detailSource).toContain('const requestedId = supplierId.value')