merge release test changes and preserve local frontend updates

This commit is contained in:
2026-09-20 15:23:26 +08:00
parent 53c887d353
commit 940010dcc2
10 changed files with 100 additions and 19 deletions
@@ -109,19 +109,27 @@ describe('RelabelOrdersView', () => {
}))
})
it('offers only backend-allowed audit transitions', async () => {
it('hides the audit action after approval', async () => {
vi.mocked(listRelabelOrders).mockResolvedValueOnce({
records: [{ id: '1', relabelNo: 'RL-1', customerOrderNo: 'CO-1', skuCodes: 'SKU-1', totalPackageCount: 2, status: 'PENDING_PROCESSING' }],
page: 1, size: 10, total: 1, pages: 1,
})
const wrapper = mount(RelabelOrdersView, { attachTo: document.body, global: { plugins: [ElementPlus] } })
await flushPromises()
await wrapper.findAll('button').find((button) => button.text().includes('审核'))!.trigger('click')
await flushPromises()
expect(wrapper.findAll('button').some((button) => button.text().trim() === '审核')).toBe(false)
})
const labels = formItem(wrapper, '目标状态').findAllComponents({ name: 'ElOption' }).map((option) => option.props('label'))
expect(labels).toEqual(expect.arrayContaining(['处理中', '已驳回', '已取消']))
expect(labels).not.toContain('已完成')
it('shows the audit action only while pending review', async () => {
vi.mocked(listRelabelOrders).mockResolvedValueOnce({
records: [{ id: '1', relabelNo: 'RL-1', customerOrderNo: 'CO-1', skuCodes: 'SKU-1', totalPackageCount: 2, status: 'PENDING_REVIEW' }],
page: 1, size: 10, total: 1, pages: 1,
})
const wrapper = mount(RelabelOrdersView, { attachTo: document.body, global: { plugins: [ElementPlus] } })
await flushPromises()
await wrapper.findAll('button').find((button) => button.text().trim() === '审核')!.trigger('click')
await flushPromises()
const labels = formItem(wrapper, '审核动作').findAllComponents({ name: 'ElOption' }).map((option) => option.props('label'))
expect(labels).toEqual(['审核通过', '已驳回'])
})
it('passes the relabel order number search to the backend', async () => {