diff --git a/test/EstateRegistry.js b/test/EstateRegistry.js index 9eebd99..b8d8f41 100644 --- a/test/EstateRegistry.js +++ b/test/EstateRegistry.js @@ -1240,13 +1240,27 @@ contract('EstateRegistry', accounts => { }) it('reverts if not owner or approvedForAll set updateManager', async function() { + // Not owner await assertRevert( estate.setUpdateManager(user, operator, true, sentByAnotherUser) ) + // Hacker await assertRevert( estate.setUpdateManager(user, operator, true, sentByHacker) ) + + // Operator + await estate.approve(operator, 1, sentByUser) + await assertRevert( + estate.setUpdateManager(user, operator, true, sentByOperator) + ) + + // Update Operator + await estate.setUpdateOperator(1, anotherUser, sentByUser) + await assertRevert( + estate.setUpdateManager(user, operator, true, sentByAnotherUser) + ) }) it('reverts when updateManager trying to transfer', async function() { diff --git a/test/LANDRegistry.js b/test/LANDRegistry.js index 002cf18..04e193f 100644 --- a/test/LANDRegistry.js +++ b/test/LANDRegistry.js @@ -1048,13 +1048,27 @@ contract('LANDRegistry', accounts => { }) it('reverts if not owner or approvedForAll set updateManager', async function() { + // Not owner await assertRevert( land.setUpdateManager(user, operator, true, sentByAnotherUser) ) + // Hacker await assertRevert( land.setUpdateManager(user, operator, true, sentByHacker) ) + + // Operator + await land.approve(operator, 1, sentByUser) + await assertRevert( + land.setUpdateManager(user, operator, true, sentByOperator) + ) + + // Update Operator + await land.setUpdateOperator(1, anotherUser, sentByUser) + await assertRevert( + land.setUpdateManager(user, operator, true, sentByAnotherUser) + ) }) it('reverts when updateManager trying to transfer', async function() {