This commit is contained in:
2026-10-16 18:25:49 +08:00
parent 2705fdbc49
commit 4806f88d7c
6 changed files with 121 additions and 167 deletions
@@ -12,12 +12,13 @@ describe('贴标附件回显', () => {
const wrapper = mountPanel(); await flushPromises()
const rows = wrapper.findAll('.el-table__body tbody tr')
expect(rows).toHaveLength(4)
expect(wrapper.text()).toContain('箱唛.pdf'); expect(wrapper.text()).toContain('SKU.pdf')
expect(wrapper.text()).toContain('面单.pdf'); expect(wrapper.text()).toContain('明细.pdf')
expect(wrapper.text()).toContain('BX-1 / SKU-A')
expect(wrapper.text()).toContain('箱唛贴标文件'); expect(wrapper.text()).toContain('SKU 贴标文件')
expect(wrapper.text()).toContain('面单文件'); expect(wrapper.text()).toContain('明细文件')
expect(wrapper.text()).not.toContain('BX-1 / SKU-A'); expect(wrapper.text()).not.toContain('文件名称'); expect(wrapper.text()).not.toContain('查看'); expect(wrapper.text()).not.toContain('箱唛.pdf')
expect(wrapper.findAll('thead th')).toHaveLength(2)
expect(getRelabelOrder).not.toHaveBeenCalled()
})
it('预览请求使用申请号、文件分类及明细编号,并可重试失败请求', async () => {
it('下载请求使用申请号、文件分类及明细编号,并可重试失败请求', async () => {
vi.mocked(downloadRelabelDocument).mockRejectedValue(new Error('文件暂不可用'))
const wrapper = mountPanel(); await flushPromises()
const rows = wrapper.findAll('.el-table__body tbody tr')
@@ -32,6 +33,6 @@ describe('贴标附件回显', () => {
const wrapper = mount(RelabelDocumentsPanel, { props: { relabelNo: 'RL-1' }, global: { plugins: [ElementPlus] } }); await flushPromises()
expect(wrapper.get('[role="alert"]').text()).toContain('资料加载失败')
await wrapper.get('[role="alert"] button').trigger('click'); await flushPromises()
expect(wrapper.text()).toContain('箱唛.pdf')
expect(wrapper.text()).toContain('箱唛贴标文件')
})
})