Skip to content

Commit

Permalink
Merge pull request #860 from AutarkLabs/582-projects-test-coverage
Browse files Browse the repository at this point in the history
582 - Increase projects contract coverage
  • Loading branch information
topocount committed May 9, 2019
2 parents e15db14 + 151e2a2 commit 2a92ce6
Show file tree
Hide file tree
Showing 7 changed files with 1,266 additions and 1,163 deletions.
15 changes: 8 additions & 7 deletions apps/address-book/test/address-book.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,25 @@ contract('AddressBook App', accounts => {
})

it('should revert when adding duplicate address', async () => {
assertRevert(async () => {
return assertRevert(async () => {
await app.addEntry(borg, 'Burg', 'N/A')
})
})
it('should revert when adding duplicate name', async () => {
assertRevert(async () => {
return assertRevert(async () => {
await app.addEntry(jeanluc, 'Borg', 'Captain')
})
})
it('should revert when removing not existant entry', async () => {
assertRevert(async () => {
return assertRevert(async () => {
await app.removeEntry(jeanluc)
})
})
it('should revert when getting non-existant entry', async () => {
assertRevert(async () => {
await app.getEntry(jeanluc)
})
it('should return a zero-address when getting non-existant entry', async () => {
const [ entryAddress, name, entryType ] = await app.getEntry(jeanluc)
assert.strictEqual(entryAddress, '0x0000000000000000000000000000000000000000', 'address should be 0x0')
assert.strictEqual(name, '', 'name should be empty')
assert.strictEqual(entryType, '', 'entry Type should be empty')
})
})
})
9 changes: 7 additions & 2 deletions apps/allocations/test/allocations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ contract('Allocations App', accounts => {
supports,
zeros,
'',
'',
'ETH description',
zeros,
zeros,
accountId,
Expand All @@ -152,7 +152,7 @@ contract('Allocations App', accounts => {
supports,
zeros,
'',
'',
'token description',
zeros,
zeros,
accountId,
Expand Down Expand Up @@ -234,6 +234,11 @@ contract('Allocations App', accounts => {
assert.strictEqual(payoutInfo[3].toNumber(), 0, 'recurring payout period length incorrect')
})

it('retrieves payout description', async () =>{
const payoutDescription = await app.getPayoutDescription(accountId,ethPayoutId)
assert.strictEqual(payoutDescription, 'ETH description', 'Payout description incorrectly stored')
})

it('sets the distribution (token)', async () => {
const candidateArrayLength = (await app.getNumberOfCandidates(
accountId,
Expand Down
6 changes: 2 additions & 4 deletions apps/projects/contracts/Projects.sol
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ contract Projects is IsContract, AragonApp {


/**
* @notice Update settings for the Projects app
* @notice Update settings for the Projects app
*/
function changeBountySettings(
uint256[] _expMultipliers,
Expand Down Expand Up @@ -441,9 +441,7 @@ contract Projects is IsContract, AragonApp {
submission.submissionHash = _updatedSubmissionHash;

if (_approved) {
if (issue.hasBounty) {
bounties.acceptFulfillment(issue.standardBountyId, submission.fulfillmentId);
}
bounties.acceptFulfillment(issue.standardBountyId, submission.fulfillmentId);
issue.fulfilled = true;
submission.status = SubmissionStatus.Accepted;
emit SubmissionAccepted(_submissionNumber, _repoId, _issueNumber);
Expand Down
Loading

0 comments on commit 2a92ce6

Please sign in to comment.