mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
test: updated permission manager tests for isInAnyRole, isInAllRoles
This commit is contained in:
parent
088d2733cf
commit
42c6123697
|
@ -78,6 +78,24 @@ makeSuite('Permission manager', (testEnv: TestEnv) => {
|
|||
expect(mappedPermissions.indexOf(LIQUIDATOR.toString())).to.be.gte(0);
|
||||
});
|
||||
|
||||
it('Checks isInAllRoles (positive test)', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
const result = await permissionManager.isInAllRoles(users[0].address, [DEPOSITOR, BORROWER, LIQUIDATOR])
|
||||
|
||||
expect(result).to.be.equal(true, "Invalid result for isInAllRoles");
|
||||
});
|
||||
|
||||
|
||||
it('Checks isInAnyRole (positive test)', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
const result = await permissionManager.isInAnyRole(users[0].address, [DEPOSITOR, BORROWER, LIQUIDATOR])
|
||||
|
||||
expect(result).to.be.equal(true, "Invalid result for isInAnyRole");
|
||||
});
|
||||
|
||||
|
||||
it('Removes the depositor', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
|
@ -92,6 +110,15 @@ makeSuite('Permission manager', (testEnv: TestEnv) => {
|
|||
expect(isLiquidator).to.be.equal(true);
|
||||
});
|
||||
|
||||
it('Checks isInAllRoles (negative test)', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
const result = await permissionManager.isInAllRoles(users[0].address, [DEPOSITOR, BORROWER, LIQUIDATOR])
|
||||
|
||||
expect(result).to.be.equal(false, "Invalid result for isInAllRoles");
|
||||
});
|
||||
|
||||
|
||||
it('Removes the borrower', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
|
@ -106,6 +133,14 @@ makeSuite('Permission manager', (testEnv: TestEnv) => {
|
|||
expect(isLiquidator).to.be.equal(true);
|
||||
});
|
||||
|
||||
it('Checks isInAnyRole (negative test)', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
const result = await permissionManager.isInAnyRole(users[0].address, [DEPOSITOR, BORROWER])
|
||||
|
||||
expect(result).to.be.equal(false, "Invalid result for isInAnyRole");
|
||||
});
|
||||
|
||||
it('Removes the liquidator', async () => {
|
||||
const { users } = testEnv;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user