Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Don't show pending votes in voting dialog - Closes #741 #742

Merged
merged 1 commit into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/voteDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
8 changes: 4 additions & 4 deletions src/components/voteDialog/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {} },
});
Expand All @@ -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');
Expand Down