20260917165839

This commit is contained in:
oneao committed 2026-09-17 16:58:40 +08:00
1 parent 182ed86966
commit 38e1e66c3b
108 files changed
+2497 -1215

No files matched your search

@@ -167,6 +167,24 @@ describe('往来单位:删除分类的两条守卫', () => {
expect(saveObjectApi).not.toHaveBeenCalled()
})
it('守卫查询带 order_by:/data/page 缺排序字段后端直接报「order_by 不能为空」', async () => {
const wrapper = await mountOthercompany()
await wrapper.vm.onCategoryDelete({ b_id: 'child1' })
expect(pageDataApi).toHaveBeenCalledTimes(1)
expect(pageDataApi.mock.calls[0][0]).toMatchObject({
viewName: 'v_b_othercompany',
orderBy: 'b_id ASC',
searchCondition: "[b_cate_id] = 'child1'",
searchColumns: ['b_id'],
pageNo: 1,
pageSize: 1,
})
// 带上排序字段后守卫能正常通过,不再走错误分支
expect(Message.error).not.toHaveBeenCalled()
})
it('分类下还有往来单位时拦下,不发删除请求', async () => {
const wrapper = await mountOthercompany()
pageDataApi.mockResolvedValueOnce({ data: { rows: [{ b_id: 'OC001' }], total: 1 } })