diff --git a/src/components/voteDialog/index.js b/src/components/voteDialog/index.js index 28f3c89eb..4e0551923 100644 --- a/src/components/voteDialog/index.js +++ b/src/components/voteDialog/index.js @@ -3,8 +3,8 @@ import { votePlaced, addedToVoteList, removedFromVoteList } from '../../actions/ import VoteDialog from './voteDialog'; const mapStateToProps = state => ({ - votedList: state.voting.votedList, - unvotedList: state.voting.unvotedList, + votedList: state.voting.votedList.filter(item => !item.pending), + unvotedList: state.voting.unvotedList.filter(item => !item.pending), account: state.account, activePeer: state.peers.data, }); diff --git a/src/components/voteDialog/index.test.js b/src/components/voteDialog/index.test.js index 86e8c8657..b90d575c9 100644 --- a/src/components/voteDialog/index.test.js +++ b/src/components/voteDialog/index.test.js @@ -40,8 +40,8 @@ const unvotedList = [ const store = configureMockStore([])({ account: ordinaryAccount, voting: { - votedList, - unvotedList, + votedList: [...votedList, { pending: true, username: 'pending' }], + unvotedList: [...unvotedList, { pending: true, username: 'pending2' }], }, peers: { data: {} }, }); @@ -59,8 +59,8 @@ describe('VoteDialog HOC', () => { it('should pass appropriate properties to VoteDialog', () => { const confirmVotesProps = wrapper.find('VoteDialog').props(); - expect(confirmVotesProps.votedList).to.be.equal(votedList); - expect(confirmVotesProps.unvotedList).to.be.equal(unvotedList); + expect(confirmVotesProps.votedList).to.be.deep.equal(votedList); + expect(confirmVotesProps.unvotedList).to.be.deep.equal(unvotedList); expect(confirmVotesProps.account).to.be.equal(ordinaryAccount); expect(confirmVotesProps.activePeer).to.deep.equal({}); expect(typeof confirmVotesProps.votePlaced).to.be.equal('function');