Commit 8315e7ae 8315e7aeca4a2169d5e80d0df4627cf493646a69 by Vincent Peybernes

#8 Improve result test of election

1 parent 6c7d68e7
Pipeline #14 for 8315e7ae passed in 56 seconds
......@@ -158,5 +158,18 @@ describe('RelativePlacement global', () => {
assert.ok(candidates.every(name => result.indexOf(name) != -1));
assert.ok(result.every(name => candidates.indexOf(name) != -1));
});
it('should have placements sum in candidates', () => {
election.addVote(['A', 'B', 'C']);
election.addVote(['B', 'A', 'C']);
election.addVote(['A', 'C', 'B']);
election.getResult();
var candidate = election.candidateList['A'];
assert.equal(candidate.placements.length, 3);
assert.equal(candidate.cumulativePlacement.length, 3);
assert.equal(candidate.votes.length, 4);
});
});
});
\ No newline at end of file
......