完善预约确认与排车表单并统一计费和筛选展示
This commit is contained in:
@@ -139,19 +139,19 @@ describe('native delivery operation dialogs', () => {
|
||||
it('keeps readonly document facts plain and only exposes saved downloads', async () => {
|
||||
api.documents.mockResolvedValueOnce({ ...documents(), allowedActions: [] })
|
||||
const { dialog } = await openDocuments()
|
||||
expect(dialog.props('showConfirm')).toBe(false); expect(dialog.text()).toContain('当前账号仅可查看已保存资料')
|
||||
expect(dialog.props('showConfirm')).toBe(false)
|
||||
expect(dialog.findAll('input')).toHaveLength(0); expect(dialog.text()).toContain('BOL-1')
|
||||
expect(dialog.findAll('[data-category]')).toHaveLength(3)
|
||||
expect(dialog.findAll('button').some(button => button.text() === '上传')).toBe(false)
|
||||
await dialog.get('[aria-label="下载 完整文件名称.pdf"]').trigger('click'); await flushPromises(); expect(api.download).toHaveBeenCalledOnce()
|
||||
})
|
||||
it('shows an unavailable summary after a document read failure and retries within scope', async () => {
|
||||
it('shows the document read failure and retries within scope', async () => {
|
||||
api.documents.mockRejectedValueOnce(new ApiResponseError('读取失败', 'A0503', 503, null, 'document-read-request'))
|
||||
const { dialog } = await openDocuments()
|
||||
expect(dialog.text()).toContain('document-read-request'); expect(dialog.text()).toContain('资料未返回')
|
||||
expect(dialog.text()).not.toContain('正在读取…'); expect(dialog.props('showConfirm')).toBe(false)
|
||||
expect(dialog.text()).toContain('document-read-request'); expect(dialog.findComponent(LoadErrorState).props('message')).toBe('读取失败')
|
||||
expect(dialog.findAll('[data-category]')).toHaveLength(0); expect(dialog.props('showConfirm')).toBe(false)
|
||||
dialog.findComponent(LoadErrorState).vm.$emit('retry'); await flushPromises()
|
||||
expect(api.documents).toHaveBeenLastCalledWith('DEL/1', 'C1'); expect(dialog.text()).toContain('1/3 已上传')
|
||||
expect(api.documents).toHaveBeenLastCalledWith('DEL/1', 'C1'); expect(dialog.findAll('.document-file')).toHaveLength(1)
|
||||
})
|
||||
it('retains conflicting document drafts until confirmed reload', async () => {
|
||||
const confirmation = vi.spyOn(ElMessageBox, 'confirm').mockRejectedValueOnce('cancel')
|
||||
|
||||
Reference in New Issue
Block a user