Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
future-apps/payroll/test/contracts/Payroll_constants.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const Payroll = artifacts.require('Payroll') | ||
|
||
contract('Payroll roles', () => { | ||
let payroll | ||
|
||
beforeEach('create new payroll instance', async () => { | ||
payroll = await Payroll.new() | ||
}) | ||
|
||
describe('roles', () => { | ||
it('should implement role constants successfully', async () => { | ||
assert.equal(await payroll.ADD_EMPLOYEE_ROLE(), web3.sha3('ADD_EMPLOYEE_ROLE'), 'add employee role does not match') | ||
assert.equal(await payroll.TERMINATE_EMPLOYEE_ROLE(), web3.sha3('TERMINATE_EMPLOYEE_ROLE'), 'terminate employee role does not match') | ||
assert.equal(await payroll.SET_EMPLOYEE_SALARY_ROLE(), web3.sha3('SET_EMPLOYEE_SALARY_ROLE'), 'set employee salary does not match') | ||
assert.equal(await payroll.ADD_BONUS_ROLE(), web3.sha3('ADD_BONUS_ROLE'), 'add bonus role does not match') | ||
assert.equal(await payroll.ADD_REIMBURSEMENT_ROLE(), web3.sha3('ADD_REIMBURSEMENT_ROLE'), 'add reimbursement role does not match') | ||
assert.equal(await payroll.ALLOWED_TOKENS_MANAGER_ROLE(), web3.sha3('ALLOWED_TOKENS_MANAGER_ROLE'), 'allowed tokens manager role does not match') | ||
assert.equal(await payroll.CHANGE_PRICE_FEED_ROLE(), web3.sha3('CHANGE_PRICE_FEED_ROLE'), 'change price feed does not match') | ||
assert.equal(await payroll.MODIFY_RATE_EXPIRY_ROLE(), web3.sha3('MODIFY_RATE_EXPIRY_ROLE'), 'modify rate expiry role does not match') | ||
}) | ||
}) | ||
}) |