优化
This commit is contained in:
@@ -56,6 +56,20 @@ beforeEach(() => {
|
||||
afterEach(() => vi.unstubAllGlobals())
|
||||
|
||||
describe('truck review and fulfillment', () => {
|
||||
it('groups the business number, single status and actions in the shared detail header', async () => {
|
||||
const wrapper = mountDetail(); await flushPromises()
|
||||
const header = wrapper.find('.detail-page-layout__header')
|
||||
expect(header.find('.density-detail-title').text()).toBe('本土卡车订单 TR-TEST')
|
||||
expect(header.find('.status-badge').text()).toBe('待审核')
|
||||
expect(wrapper.findAll('.status-badge')).toHaveLength(1)
|
||||
expect(header.find('.truck-order-actions').text()).toContain('审核')
|
||||
expect(header.find('.truck-order-actions').text()).toContain('取消订单')
|
||||
await click(wrapper, '刷新订单')
|
||||
expect(getUsTruckOrder).toHaveBeenCalledTimes(2)
|
||||
await click(wrapper, '返回列表')
|
||||
expect(routing.push).toHaveBeenCalledWith({ name: 'overseas-business-trucks' })
|
||||
})
|
||||
|
||||
it('loads customer scoped documents and runs review through receipt, allocation and delivery completion', async () => {
|
||||
let current = order()
|
||||
vi.mocked(executeUsTruckCommand).mockImplementation(async (_no, _customer, operation) => {
|
||||
@@ -119,6 +133,7 @@ describe('truck review and fulfillment', () => {
|
||||
const wrapper = mountDetail(); await flushPromises(); await click(wrapper, '审核'); await confirm(wrapper); await confirm(wrapper)
|
||||
expect(executeUsTruckCommand).toHaveBeenCalledTimes(1)
|
||||
expect(wrapper.findComponent(AppDialog).props('confirmLoading')).toBe(true)
|
||||
for (const button of wrapper.find('.detail-page-layout__header').findAll('button')) expect(button.attributes('disabled')).toBeDefined()
|
||||
finish(order({ status: 'WAITING_INBOUND', version: 2 })); await flushPromises()
|
||||
expect(wrapper.text()).toContain('登记实收')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user