20260914224947

This commit is contained in:
oneao committed 2026-09-14 22:49:48 +08:00
1 parent 63514476d7
commit d26afb5fec
69 files changed
+158 -1008

No files matched your search

@@ -1,5 +1,5 @@
/**
* 回归用例:往来单位分类树(b_othercompany_bmfl)的新增 / 修改 / 删除 / 拖拽排序。
* 回归用例:往来单位分类树(b_othercompany_category)的新增 / 修改 / 删除 / 拖拽排序。
*
* 1) b_path 为 not null 且无默认值(b_depth / b_xh / b_canuse 才有默认值),新增分类时
* 必须按父级派生 b_depth / b_path 一起写入,否则插入直接失败;
@@ -77,7 +77,7 @@ beforeEach(() => {
Message.warning.mockClear()
modalConfirm.mockReset()
loadDataApi.mockImplementation((view) => {
if (view === 'b_othercompany_bmfl')
if (view === 'b_othercompany_category')
return Promise.resolve({ data: CATEGORIES.map((row) => ({ ...row })) })
return Promise.resolve({ data: [] })
})
@@ -110,7 +110,7 @@ describe('往来单位:新增分类写派生树字段', () => {
await wrapper.vm.onCategorySubmit({ b_id: 'newcat', b_name: '新分类', b_xh: 30 })
await flushPromises()
const request = lastRequestOf('b_othercompany_bmfl')
const request = lastRequestOf('b_othercompany_category')
expect(request.key_field).toBe('b_id')
expect(request.inserts).toHaveLength(1)
expect(request.inserts[0]).toMatchObject({
@@ -131,7 +131,7 @@ describe('往来单位:新增分类写派生树字段', () => {
await wrapper.vm.onCategorySubmit({ b_id: 'child2', b_name: '三级分类', b_xh: 20 })
await flushPromises()
expect(lastRequestOf('b_othercompany_bmfl').inserts[0]).toMatchObject({
expect(lastRequestOf('b_othercompany_category').inserts[0]).toMatchObject({
b_id: 'child2',
b_parent_id: 'root1',
b_depth: 1,
@@ -148,7 +148,7 @@ describe('往来单位:修改分类', () => {
await wrapper.vm.onCategorySubmit({ b_id: 'child1', b_name: '改过的名字', b_xh: 99 })
await flushPromises()
const request = lastRequestOf('b_othercompany_bmfl')
const request = lastRequestOf('b_othercompany_category')
expect(request.inserts).toBeUndefined()
expect(request.updates).toHaveLength(1)
expect(request.updates[0]).toEqual({ b_id: 'child1', b_name: '改过的名字', b_xh: 99 })
@@ -190,7 +190,7 @@ describe('往来单位:删除分类的两条守卫', () => {
await modalConfirm.mock.calls[0][0].onOk()
await flushPromises()
const request = lastRequestOf('b_othercompany_bmfl')
const request = lastRequestOf('b_othercompany_category')
expect(request.deletes).toEqual([{ b_id: 'child1' }])
})
})