Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should render a the Home component', () => {
const spy = sinon.spy()
expect(spy.called).toEqual(false)
const wrapper = mount()
expect(spy.called).toEqual(true)
expect(wrapper.find('h1').text()).toEqual('Hello test')
})
})
it('should render a router', () => {
const wrapper = mount()
expect(wrapper.find(BrowserRouter).length).toEqual(1)
})
})
it('should get container', () => {
state.injectReducer('home', reducer)
state.injectSagas(sagas)
const wrapper = mount(
)
const home = wrapper.find(Home)
expect(home.prop('greetings')).toEqual('Everyone !!!')
})
})
it('should render the component once it is loaded', done => {
const component = () => (<h1>Hello world</h1>)
const spy = sinon.spy(() => Promise.resolve(component))
const wrapper = mount(
{Component => (
)}
)
setTimeout(() => {
try {
expect(wrapper.find('h1').text()).toEqual('Hello world')
done()
} catch (e) {
done.fail(e)
}
it('should render the component once it is loaded', () => {
const wrapper = mount(
)
setTimeout(() => {
expect(wrapper.contains(
)).toEqual(true)
}, 100)
})
})