Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #886 from LiskHQ/835-functional_test_type_3
Browse files Browse the repository at this point in the history
Remove brittle test from functional post type 3 - Close #835
  • Loading branch information
Isabella Dell authored Oct 23, 2017
2 parents 8cc975d + 55204fb commit b9c1e46
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions test/functional/http/post/3.votes.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('POST /api/transactions (type 3) votes', function () {
});
});

it('upvoting ' + (constants.activeDelegates + 1) + ' delegates (number of actived delegates + 1) separately should be ok and only 101 votes confirmed', function () {
it('upvoting ' + constants.activeDelegates + ' delegates (number of actived delegates) separately should be ok', function () {
var transaction1 = node.lisk.vote.createVote(accountMaxVotesPerAccount.password, delegatesMaxVotesPerAccount.slice(0, 33).map(function (delegate) {
return '+' + delegate.publicKey;
}));
Expand All @@ -273,23 +273,14 @@ describe('POST /api/transactions (type 3) votes', function () {
var transaction4 = node.lisk.vote.createVote(accountMaxVotesPerAccount.password, delegatesMaxVotesPerAccount.slice(99, 102).map(function (delegate) {
return '+' + delegate.publicKey;
}));
// This transaction will be accepted but not confirmed due to we reach the maximum allowed votes
var transaction5 = node.lisk.vote.createVote(accountMaxVotesPerAccount.password, ['+' + node.eAccount.publicKey]);

// First transaction to arrive is the last one to be confirmed
return sendTransactionPromise(transaction5)
.then(function (res) {
node.expect(res).to.have.property('success').to.be.ok;
node.expect(res).to.have.property('transactionId').to.equal(transaction5.id);
badTransactions.push(transaction5);

var promises = [];
promises.push(sendTransactionPromise(transaction1));
promises.push(sendTransactionPromise(transaction2));
promises.push(sendTransactionPromise(transaction3));
promises.push(sendTransactionPromise(transaction4));
return node.Promise.all(promises);
})
var promises = [];
promises.push(sendTransactionPromise(transaction1));
promises.push(sendTransactionPromise(transaction2));
promises.push(sendTransactionPromise(transaction3));
promises.push(sendTransactionPromise(transaction4));

return node.Promise.all(promises)
.then(function (res) {
res.forEach(function (result) {
node.expect(result).to.have.property('success').to.be.ok;
Expand Down

0 comments on commit b9c1e46

Please sign in to comment.