This commit is contained in:
2026-09-09 10:26:17 +08:00
parent 1249263b94
commit 229489271d
8 changed files with 87 additions and 22 deletions
@@ -80,7 +80,7 @@ describe('ContainersView', () => {
await router.push('/'); await router.isReady()
const wrapper = mount(ContainersView, { props: { workbench: 'OVERSEAS' }, attachTo: document.body, global: { plugins: [ElementPlus, router] } })
await flushPromises()
const buttons = wrapper.findAll('button').filter((item) => item.text().includes('确认还柜/还空'))
const buttons = wrapper.findAll('button').filter((item) => item.text().includes('确认还柜'))
expect(buttons).toHaveLength(1)
await buttons[0].trigger('click')
await flushPromises()
@@ -98,7 +98,7 @@ describe('ContainersView', () => {
accessCan.mockImplementation((code) => code !== 'platform:firstleg:terminal-drayage:empty-return:confirm')
const wrapper = mount(ContainersView, { props: { workbench: 'OVERSEAS' }, global: { plugins: [ElementPlus, router] } })
await flushPromises()
expect(wrapper.findAll('button').some((item) => item.text().includes('确认还柜/还空'))).toBe(false)
expect(wrapper.findAll('button').some((item) => item.text().includes('确认还柜'))).toBe(false)
wrapper.unmount()
accessCan.mockReturnValue(true)
const allowedWrapper = mount(ContainersView, { props: { workbench: 'OVERSEAS' }, global: { plugins: [ElementPlus, router] } })
@@ -106,7 +106,7 @@ describe('ContainersView', () => {
const vm = allowedWrapper.vm as unknown as { rows: Array<{ allowedActions?: string[] }> }
vm.rows[0].allowedActions = vm.rows[0].allowedActions?.filter((action) => action !== 'RECORD_EMPTY_RETURN')
await allowedWrapper.vm.$nextTick()
expect(allowedWrapper.findAll('button').some((item) => item.text().includes('确认还柜/还空'))).toBe(false)
expect(allowedWrapper.findAll('button').some((item) => item.text().includes('确认还柜'))).toBe(false)
})
it('defers form options until their dialogs open and caches successful loads', async () => {
@@ -353,7 +353,7 @@ describe('ContainersView', () => {
vm.openDrayageAction(vm.rows[0], 'RECORD_EMPTY_RETURN')
vm.drayageActionAt = '2026-09-11T13:00:00'
await vm.saveDrayageAction()
expect(recordTerminalDrayageEmptyReturn).toHaveBeenCalledWith('9001', { expectedVersion: 4, actualAt: '2026-09-11T13:00:00', reason: undefined })
expect(recordTerminalDrayageEmptyReturn).toHaveBeenCalledWith('9001', { expectedVersion: 4, actualAt: '2026-09-11T13:00:00', remark: undefined })
expect(wrapper.text()).toContain('已还柜')
wrapper.unmount()
})