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

Commit

Permalink
Fix a bug in voteDialog integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yasharAyari committed Nov 14, 2017
1 parent 15dce2a commit 3943894
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions test/integration/voteDialog/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ const keyCodes = {
escape: 27,
};

const store = prepareStore({
account: accountReducer,
voting: votingReducer,
peers: peersReducer,
});

const realAccount = {
address: '16313739661670634666L',
balance: '346215336704',
Expand Down Expand Up @@ -81,14 +75,11 @@ const peers = {
},
};

store.dispatch(accountLoggedIn(realAccount));
store.dispatch({
data: peers,
type: actionTypes.activePeerSet,
});
const wrapper = mount(renderWithRouter(VoteDialog, store));
let clock;
describe('@integration test of VoteDialog', () => {
describe.only('@integration test of VoteDialog', () => {
let store;
let wrapper;
let clock;

beforeEach(() => {
clock = sinon.useFakeTimers({
toFake: ['setTimeout', 'clearTimeout', 'Date'],
Expand All @@ -99,6 +90,18 @@ describe('@integration test of VoteDialog', () => {
});

step('Given user is login in', () => {
store = prepareStore({
account: accountReducer,
voting: votingReducer,
peers: peersReducer,
});

store.dispatch(accountLoggedIn(realAccount));
store.dispatch({
data: peers,
type: actionTypes.activePeerSet,
});
wrapper = mount(renderWithRouter(VoteDialog, store));
expect(store.getState().account).to.be.an('Object');
expect(store.getState().voting).to.be.an('Object');
expect(store.getState().peers).to.be.an('Object');
Expand Down

0 comments on commit 3943894

Please sign in to comment.