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

Commit

Permalink
Fix unit test coverage of SavedAccountsHOC
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Nov 9, 2017
1 parent c48244b commit 0dbd61c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/savedAccounts/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import i18n from '../../i18n';
import SavedAccountsHOC from './index';
import * as savedAccounts from '../../actions/savedAccounts';


describe('SavedAccountsHOC', () => {
let wrapper;

Expand Down Expand Up @@ -45,7 +44,21 @@ describe('SavedAccountsHOC', () => {

it('should bind accountSaved action to SavedAccounts props.accountSaved', () => {
const actionsSpy = sinon.spy(savedAccounts, 'accountSaved');
wrapper.find('SavedAccounts button.add-active-account-button').simulate('click');
wrapper.find('SavedAccounts').props().accountSaved({});
expect(actionsSpy).to.be.calledWith();
actionsSpy.restore();
});

it('should bind accountRemoved action to SavedAccounts props.accountRemoved', () => {
const actionsSpy = sinon.spy(savedAccounts, 'accountRemoved');
wrapper.find('SavedAccounts').props().accountRemoved({});
expect(actionsSpy).to.be.calledWith();
actionsSpy.restore();
});

it('should bind accountSwitched action to SavedAccounts props.accountSwitched', () => {
const actionsSpy = sinon.spy(savedAccounts, 'accountSwitched');
wrapper.find('SavedAccounts').props().accountSwitched({});
expect(actionsSpy).to.be.calledWith();
actionsSpy.restore();
});
Expand Down

0 comments on commit 0dbd61c

Please sign in to comment.