You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
import { connectionCanEdit } from '../app.service'; |
|
const connection = { |
|
connectionId: '', |
|
connectionType: '', |
|
connectionName: '', |
|
connectionData: '', |
|
}; |
|
|
|
test('BI-51537 判断数据连接是否有权限', () => { |
|
expect(connectionCanEdit({ |
|
...connection, |
|
})).toEqual(true); |
|
|
|
expect(connectionCanEdit({ |
|
...connection, |
|
privilegeDetailBeanList: null, |
|
})).toEqual(true); |
|
|
|
expect(connectionCanEdit({ |
|
...connection, |
|
privilegeDetailBeanList: [ |
|
{ |
|
privilegeType: 4, |
|
privilegeValue: 2, |
|
}, |
|
], |
|
})).toEqual(true); |
|
|
|
expect(connectionCanEdit({ |
|
...connection, |
|
privilegeDetailBeanList: [ |
|
{ |
|
privilegeType: 4, |
|
privilegeValue: 1, |
|
}, |
|
], |
|
})).toEqual(false); |
|
|
|
expect(connectionCanEdit({ |
|
...connection, |
|
privilegeDetailBeanList: [ |
|
{ |
|
privilegeType: 2, |
|
privilegeValue: 1, |
|
}, |
|
], |
|
})).toEqual(false); |
|
});
|
|
|