This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from LiskHQ/531-unit-test-coverage
Review and improve React unit test coverage - Closes #531
- Loading branch information
Showing
27 changed files
with
537 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { mount } from 'enzyme'; | ||
import { Provider } from 'react-redux'; | ||
import sinon from 'sinon'; | ||
import * as accountActions from '../../actions/account'; | ||
import * as dialogActions from '../../actions/dialog'; | ||
import Header from './index'; | ||
import store from '../../store'; | ||
|
||
|
||
describe('Header', () => { | ||
let wrapper; | ||
|
||
beforeEach(() => { | ||
wrapper = mount(<Provider store={store}><Header /></Provider>); | ||
}); | ||
|
||
it('should render HeaderElement', () => { | ||
expect(wrapper.find('HeaderElement')).to.have.lengthOf(1); | ||
}); | ||
|
||
it('should bind accountLoggedOut action to HeaderElement props.logOut', () => { | ||
const actionsSpy = sinon.spy(accountActions, 'accountLoggedOut'); | ||
wrapper.find('HeaderElement').props().logOut({}); | ||
expect(actionsSpy).to.be.calledWith(); | ||
actionsSpy.restore(); | ||
}); | ||
|
||
it('should bind dialogDisplayed action to HeaderElement props.setActiveDialog', () => { | ||
const actionsSpy = sinon.spy(dialogActions, 'dialogDisplayed'); | ||
wrapper.find('HeaderElement').props().setActiveDialog({}); | ||
expect(actionsSpy).to.be.calledWith(); | ||
actionsSpy.restore(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.