|
@@ -410,10 +410,28 @@ vi.mock('@d8d/shared-ui-components/utils/hc', () => ({
|
|
|
})
|
|
})
|
|
|
}))
|
|
}))
|
|
|
},
|
|
},
|
|
|
|
|
+ index: {
|
|
|
|
|
+ $get: vi.fn(() => {
|
|
|
|
|
+ console.debug('rpcClient index.$get called (for adminAreas)');
|
|
|
|
|
+ return Promise.resolve({
|
|
|
|
|
+ status: 200,
|
|
|
|
|
+ json: async () => ({
|
|
|
|
|
+ data: [
|
|
|
|
|
+ { id: 1, name: '北京市', parentId: null, level: 1 },
|
|
|
|
|
+ { id: 2, name: '上海市', parentId: null, level: 1 },
|
|
|
|
|
+ { id: 3, name: '东城区', parentId: 1, level: 2 },
|
|
|
|
|
+ { id: 4, name: '黄浦区', parentId: 2, level: 2 },
|
|
|
|
|
+ { id: 5, name: '东城区街道', parentId: 3, level: 3 },
|
|
|
|
|
+ ],
|
|
|
|
|
+ total: 5
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
adminAreas: {
|
|
adminAreas: {
|
|
|
index: {
|
|
index: {
|
|
|
$get: vi.fn(() => {
|
|
$get: vi.fn(() => {
|
|
|
- console.debug('rpcClient areas.index.$get called');
|
|
|
|
|
|
|
+ console.debug('rpcClient adminAreas.index.$get called');
|
|
|
return Promise.resolve({
|
|
return Promise.resolve({
|
|
|
status: 200,
|
|
status: 200,
|
|
|
json: async () => ({
|
|
json: async () => ({
|
|
@@ -561,12 +579,17 @@ describe('残疾人个人管理集成测试', () => {
|
|
|
expect(call).toBeDefined();
|
|
expect(call).toBeDefined();
|
|
|
|
|
|
|
|
if (call) {
|
|
if (call) {
|
|
|
- expect(call[0].json).toMatchObject({
|
|
|
|
|
|
|
+ expect(call[0].json.personInfo).toMatchObject({
|
|
|
name: '李四',
|
|
name: '李四',
|
|
|
idCard: '110101199002021234',
|
|
idCard: '110101199002021234',
|
|
|
disabilityId: 'D123456790',
|
|
disabilityId: 'D123456790',
|
|
|
phone: '13900139000',
|
|
phone: '13900139000',
|
|
|
idAddress: '上海市黄浦区',
|
|
idAddress: '上海市黄浦区',
|
|
|
|
|
+ gender: '女',
|
|
|
|
|
+ disabilityType: '视力残疾',
|
|
|
|
|
+ disabilityLevel: '二级',
|
|
|
|
|
+ province: '1',
|
|
|
|
|
+ city: '3',
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -601,8 +624,10 @@ describe('残疾人个人管理集成测试', () => {
|
|
|
const mockClient = (disabilityClientManager.get as any)();
|
|
const mockClient = (disabilityClientManager.get as any)();
|
|
|
expect(mockClient.updateAggregatedDisabledPerson[':id']['$put']).toHaveBeenCalledWith({
|
|
expect(mockClient.updateAggregatedDisabledPerson[':id']['$put']).toHaveBeenCalledWith({
|
|
|
json: expect.objectContaining({
|
|
json: expect.objectContaining({
|
|
|
- id: 1,
|
|
|
|
|
- phone: '13800138001',
|
|
|
|
|
|
|
+ personInfo: expect.objectContaining({
|
|
|
|
|
+ id: 1,
|
|
|
|
|
+ phone: '13800138001',
|
|
|
|
|
+ }),
|
|
|
}),
|
|
}),
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|