Fix contributor list, add kredits service tests #115

Merged
raucao merged 7 commits from bugfix/114-contributor_list into master 2019-05-08 10:35:01 +00:00
2 changed files with 21 additions and 3 deletions
Showing only changes of commit e524e5558d - Show all commits
+18
View File
@@ -0,0 +1,18 @@
import Model from 'kredits-web/models/contribution';
const items = [];
const data = [
{ id: 1, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
{ id: 2, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 },
{ id: 3, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
{ id: 4, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
{ id: 5, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 },
{ id: 6, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 5000 },
{ id: 7, contributorId: 1, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 1500 },
{ id: 8, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: true, amount: 1500 },
];
data.forEach(attrs => items.push(Model.create(attrs)));
export default items;
+3 -3
View File
@@ -3,9 +3,9 @@ import Contributor from 'kredits-web/models/contributor';
const contributors = [];
const data = [
{ id: 1, name: 'Bumi', totalKreditsEarned: 5500 },
{ id: 2, name: 'Râu Cao', totalKreditsEarned: 1500 },
{ id: 3, name: 'Manuel', totalKreditsEarned: 3000 }
{ id: 1, name: 'Bumi', totalKreditsEarned: 11500 },
{ id: 2, name: 'Râu Cao', totalKreditsEarned: 3000 },
{ id: 3, name: 'Manuel', totalKreditsEarned: 0 }
];
data.forEach(attrs => contributors.push(Contributor.create(attrs)));