Skip to content

Commit

Permalink
Merge pull request #1097 from LiskHQ/1096-enable-tests-l144-l163
Browse files Browse the repository at this point in the history
Enable tests l144 - l163 - Closes #1096
  • Loading branch information
michaeltomasik committed Jul 27, 2018
2 parents d9484f7 + 9487682 commit 5bacb98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/actions/transactions.test.js
Expand Up @@ -188,7 +188,7 @@ describe('actions: transactions', () => {
});

it('should dispatch transactionAdded action if resolved', () => {
transactionsApiMock.returnsPromise().resolves({ transactionId: '15626650747375562521' });
transactionsApiMock.returnsPromise().resolves({ id: '15626650747375562521' });
const expectedAction = {
id: '15626650747375562521',
senderPublicKey: 'test_public-key',
Expand Down
14 changes: 7 additions & 7 deletions src/actions/voting.test.js
Expand Up @@ -17,8 +17,8 @@ import Fees from '../constants/fees';
import * as delegateApi from '../utils/api/delegate';

const delegateList = [
{ username: 'username1', publicKey: '123HG3452245L' },
{ username: 'username2', publicKey: '123HG3522345L' },
{ username: 'username1', publicKey: '123HG3452245L', address: '1234121321L' },
{ username: 'username2', publicKey: '123HG3522345L', address: '123L' },
];

describe('actions: voting', () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('actions: voting', () => {
it('should dispatch votesAdded action when resolved if type !== \'update\'', () => {
const dispatch = sinon.spy();

delegateApiMock.resolves({ delegates });
delegateApiMock.resolves({ data: { votes: delegates } });
const expectedAction = { list: delegates };

votesFetched(data)(dispatch);
Expand All @@ -183,7 +183,7 @@ describe('actions: voting', () => {
it('should dispatch votesUpdated action when resolved if type === \'update\'', () => {
const dispatch = sinon.spy();

delegateApiMock.resolves({ delegates });
delegateApiMock.resolves({ data: { votes: delegates } });
const expectedAction = { list: delegates };

votesFetched({ ...data, type: 'update' })(dispatch);
Expand Down Expand Up @@ -213,8 +213,8 @@ describe('actions: voting', () => {
const delegateApiMock = sinon.stub(delegateApi, 'listDelegates');
const dispatch = sinon.spy();

delegateApiMock.returnsPromise().resolves({ delegates, totalCount: 10 });
const expectedAction = { list: delegates, totalDelegates: 10, refresh: true };
delegateApiMock.returnsPromise().resolves({ data: delegates });
const expectedAction = { list: delegates, totalDelegates: delegates.length, refresh: true };

actionFunction(dispatch);
expect(dispatch).to.have.been.calledWith(delegatesAdded(expectedAction));
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('actions: voting', () => {


urlVotesFound(data)(dispatch);
delegateApiMock.resolves({ delegates });
delegateApiMock.resolves({ data: { votes: delegates } });
expect(dispatch).to.have.been.calledWith(votesAdded(expectedAction));
});

Expand Down
6 changes: 3 additions & 3 deletions src/testFiles.js
Expand Up @@ -141,11 +141,11 @@ export const unitTestsDict = [
// './actions/savedAccounts.test.js',
// './actions/toaster.test.js',
// './actions/dialog.test.js',
'./actions/voting.test.js',
// './actions/voting.test.js',
// './actions/account.test.js',
// './actions/loding.test.js',
// './actions/followedAccounts.test.js',
'./actions/transactions.test.js',
// './actions/transactions.test.js',
// './actions/peers.test.js',
// './actions/delegate.test.js',
// './actions/setting.test.js',
Expand All @@ -160,7 +160,7 @@ export const unitTestsDict = [
// './store/middlewares/peers.test.js',
// './store/middlewares/loadingBar.test.js',
// './store/middlewares/login.test.js',
'./store/subscribers/savedAccounts.test.js',
// './store/subscribers/savedAccounts.test.js',
// './store/subscribers/followedAccounts.test.js',
// './store/reducers/search.test.js',
// './store/reducers/savedAccounts.test.js',
Expand Down

0 comments on commit 5bacb98

Please sign in to comment.