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 #570 from LiskHQ/535-increase-test-coverage
Increase test coverage - Closes #535
- Loading branch information
Showing
27 changed files
with
219 additions
and
1,046 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import i18next from 'i18next'; | ||
import RegisterDelegate from '../registerDelegate'; | ||
import SavedAccounts from '../savedAccounts'; | ||
import savedAccountsTheme from '../savedAccounts/modalTheme.css'; | ||
import SecondPassphrase from '../secondPassphrase'; | ||
import Send from '../sendWritable'; | ||
|
||
export default () => ({ | ||
send: { | ||
title: i18next.t('Send'), | ||
component: Send, | ||
}, | ||
'register-delegate': { | ||
title: i18next.t('Register as delegate'), | ||
component: RegisterDelegate, | ||
}, | ||
'register-second-passphrase': { | ||
title: i18next.t('Register Second Passphrase'), | ||
component: SecondPassphrase, | ||
}, | ||
'saved-accounts': { | ||
component: SavedAccounts, | ||
theme: savedAccountsTheme, | ||
}, | ||
}); |
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,19 @@ | ||
.dialog.fullscreen { | ||
width: 100vw; /* stylelint-disable-line */ | ||
height: 100vh; /* stylelint-disable-line */ | ||
max-width: 100vw; /* stylelint-disable-line */ | ||
max-height: 100vh; /* stylelint-disable-line */ | ||
border-radius: 0; | ||
background: #013165; | ||
} | ||
|
||
.innerBody { | ||
padding: 24px; | ||
max-height: auto; | ||
} | ||
|
||
@media screen and (min-width: 600px) { | ||
.innerBody { | ||
max-height: auto; | ||
} | ||
} |
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,94 @@ | ||
/* eslint-disable */ | ||
import React from 'react'; | ||
// import { expect } from 'chai'; | ||
import { mount } from 'enzyme'; | ||
import { stub, spy } from 'sinon'; | ||
import { Provider } from 'react-redux'; | ||
import { HashRouter as Router } from 'react-router-dom'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import i18n from '../../i18n'; | ||
import Search from './index'; | ||
|
||
describe('SearchBar', () => { | ||
// let wrapper; | ||
let history; | ||
let props; | ||
let options; | ||
let localStorageStub; | ||
const store = {}; | ||
const peers = { | ||
data: {}, | ||
status: true, | ||
}; | ||
|
||
// Mocking store | ||
beforeEach(() => { | ||
localStorageStub = stub(localStorage, 'getItem'); | ||
localStorageStub.withArgs('searches').returns([]); | ||
|
||
history = { | ||
location: { | ||
pathname: 'explorer', | ||
search: '', | ||
}, | ||
push: spy(), | ||
}; | ||
props = { | ||
history, | ||
t: () => {}, | ||
}; | ||
options = { | ||
context: { | ||
store: {}, history, i18n, router: { route: history, history }, | ||
}, | ||
childContextTypes: { | ||
store: PropTypes.object.isRequired, | ||
history: PropTypes.object.isRequired, | ||
i18n: PropTypes.object.isRequired, | ||
router: PropTypes.object.isRequired, | ||
}, | ||
lifecycleExperimental: true, | ||
}; | ||
store.getState = () => ({ | ||
peers, | ||
}); | ||
store.subscribe = () => {}; | ||
store.dispatch = () => {}; | ||
// wrapper = mount( | ||
// <Provider store={store}> | ||
// <Router> | ||
// <Search {...props} /> | ||
// </Router> | ||
// </Provider>, options, | ||
// ); | ||
}); | ||
|
||
afterEach(() => { | ||
localStorageStub.restore(); | ||
}); | ||
|
||
// it('should call getSearchItem on componentWillReceiveProps', () => { | ||
// wrapper.find('Search').props().history.push('/explorer/'); | ||
// wrapper.update(); | ||
// expect(wrapper.find('Search input').props().value).to.equal(''); | ||
// wrapper.find('Search').props().history.push('/explorer/transaciton/123'); | ||
// wrapper.update(); | ||
// expect(wrapper.find('Search input')).to.have.props({ value: '123' }); | ||
// }); | ||
|
||
// it('should change input value on change event', () => { | ||
// wrapper.find('Search input').simulate('change', { target: { value: '12025' } }); | ||
// expect(wrapper.find('Search input')).to.have.props({ value: '12025' }); | ||
// }); | ||
|
||
// it('should change value on keyup event', () => { | ||
// wrapper.find('Search input').simulate('keyup', { which: 13, target: { value: '999' } }); | ||
// expect(wrapper.find('Search input')).to.have.props({ value: '999' }); | ||
// }); | ||
|
||
// it('should render Search', () => { | ||
// expect(wrapper).to.have.descendants('.search-bar-input'); | ||
// }); | ||
}); | ||
|
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,27 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { mount } from 'enzyme'; | ||
import PropTypes from 'prop-types'; | ||
import configureMockStore from 'redux-mock-store'; | ||
|
||
import i18n from '../../i18n'; | ||
import Sidechains from './index'; | ||
|
||
describe('Sidechains', () => { | ||
const store = configureMockStore([])({}); | ||
const options = { | ||
context: { store, i18n }, | ||
childContextTypes: { | ||
store: PropTypes.object.isRequired, | ||
i18n: PropTypes.object.isRequired, | ||
}, | ||
}; | ||
|
||
it('should render "Coming soon" in h2', () => { | ||
const props = { | ||
t: () => {}, | ||
}; | ||
const wrapper = mount(<Sidechains {...props} />, options); | ||
expect(wrapper.find('h2')).to.have.text('Coming soon.'); | ||
}); | ||
}); |
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,18 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { shallow } from 'enzyme'; | ||
import TransactionOverview from './transactionOverview'; | ||
|
||
describe('TransactionOverview', () => { | ||
it('should render Waypoint on smallScreen', () => { | ||
window.innerWidth = 200; | ||
const props = { | ||
t: () => {}, | ||
loading: [], | ||
transactions: [], | ||
peers: {}, | ||
}; | ||
const wrapper = shallow(<TransactionOverview {...props} />); | ||
expect(wrapper).to.have.descendants('Waypoint'); | ||
}); | ||
}); |
Oops, something went wrong.