feat(phase4): automate admin integration acceptance

This commit is contained in:
2026-08-24 15:41:36 +08:00
parent 91db777cb8
commit 964480a617
34 changed files with 1231 additions and 202 deletions
@@ -136,4 +136,19 @@ describe('CarrierScheduleQueryPanel loading states', () => {
expect(second[2]).toEqual(first[2])
expect(second[2]).toMatchObject({ expectedVersion: 1, standardNode: 'IN_TRANSIT', estimatedAt: '2026-08-22T10:00:00', actualAt: null, locationCode: 'PACIFIC', locationName: 'Pacific Ocean', reason: '船司官网人工核验', observedAt: expect.any(String) })
})
it('requires an estimated or actual time before calling the manual-node adapter', async () => {
vi.mocked(listCarrierScheduleQueries).mockResolvedValue({ records: [{ ...queryView, query: { ...queryView.query, resultPortScheduleId: null }, expired: false }], page: 1, size: 200, total: 1, pages: 1 })
vi.mocked(getCarrierScheduleQuery).mockResolvedValue({ query: { ...queryView, query: { ...queryView.query, resultPortScheduleId: null } }, nodes: [], exceptions: [], histories: [] })
const wrapper = mount(CarrierScheduleQueryPanel, { props: { oceanBookingId: '2' }, global: { plugins: [ElementPlus, pinia] } })
await flushPromises()
await wrapper.findAll('button').find((button) => button.text().includes('人工补录节点'))!.trigger('click')
wrapper.findComponent({ name: 'ElSelect' }).vm.$emit('update:modelValue', 'PICKUP_READY')
wrapper.findAllComponents({ name: 'ElInput' }).find((input) => input.props('type') === 'textarea')!.vm.$emit('update:modelValue', '人工核验可提柜')
await wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
expect(wrapper.text()).toContain('预计时间和实际时间至少填写一项')
expect(appendCarrierScheduleManualNode).not.toHaveBeenCalled()
})
})
@@ -3,6 +3,7 @@ import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'
const source = readFileSync(resolve(process.cwd(), 'src/modules/port-schedules/components/CarrierScheduleQueryPanel.vue'), 'utf8')
const apiSource = readFileSync(resolve(process.cwd(), 'src/modules/port-schedules/api/platformCarrierScheduleQueries.ts'), 'utf8')
describe('CarrierScheduleQueryPanel', () => {
it('uses the existing relation filters and never creates or executes polling tasks', () => {
@@ -60,4 +61,14 @@ describe('CarrierScheduleQueryPanel', () => {
expect(source).toContain('item.providerStatus')
expect(source).not.toContain('/' + 'manual-results')
})
it('keeps retired progress fields and forbidden write endpoints out of the panel and adapter', () => {
const productionSource = `${source}\n${apiSource}`
expect(productionSource).not.toContain(['latest', 'StandardNode'].join(''))
expect(productionSource).not.toContain(['latest', 'NodeObservedAt'].join(''))
expect(productionSource).not.toContain('/' + 'attempts')
expect(productionSource).not.toContain('/' + 'manual-results')
expect(productionSource).not.toContain('/' + 'scheduler')
expect(apiSource).toContain('/manual-nodes')
})
})