Browse Source
* commit 'b3687829fa719ce68518940d80dafc7848b3197d': fix: BI-51537 未拥有编辑权限的不可编辑、删除、重命名、复制。qufenxi
alan
5 years ago
6 changed files with 74 additions and 8 deletions
@ -0,0 +1,48 @@
|
||||
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); |
||||
}); |
Loading…
Reference in new issue