This commit is contained in:
2026-10-21 13:22:42 +08:00
parent eb0b0f85d1
commit 2333bd8bab
114 changed files with 1766 additions and 526 deletions
@@ -30,6 +30,16 @@ beforeEach(() => {
})
describe('owned business views', () => {
it('keeps a non-pool external vehicle returned by the server without filtering or requiring a vehicle id', async () => {
const detail = ownedBusinessFixture()
detail.row.vehicle = { vehicleId: null, plate: 'EXTERNAL-NO-POOL', ownership: 'DISPATCHED' }
calls.list.mockResolvedValue({ records: [detail.row], page: 1, size: 20, total: 1, summary: { dispatchCount: 1, afterLoadingCount: 1, deliveringCount: 0, deliveredCount: 0 } })
const wrapper = mount(OwnedBusinessView, { global }); await flushPromises()
expect(wrapper.findComponent(Table).props('data')[0].vehicle).toEqual(detail.row.vehicle)
expect(wrapper.findComponent(Table).props('total')).toBe(1)
expect(wrapper.text()).toContain('登记运营信息')
wrapper.unmount()
})
it('uses one list request for all statistics and never hydrates each row', async () => {
const wrapper = mount(OwnedBusinessView,{global}); await flushPromises()
expect(calls.list).toHaveBeenCalledTimes(1); expect(calls.detail).not.toHaveBeenCalled(); expect(calls.content).not.toHaveBeenCalled()