fix some tests
fix merge issues
This commit is contained in:
24
src/pages/CategoryPage/CategoryView.test.js
Normal file
24
src/pages/CategoryPage/CategoryView.test.js
Normal file
@ -0,0 +1,24 @@
|
||||
import {shallow} from 'enzyme';
|
||||
import React from 'react';
|
||||
import {CategoryView} from './CategoryView';
|
||||
|
||||
describe('<CategoryView/>', function () {
|
||||
function instance() {
|
||||
return shallow(<CategoryView match={{params: {id: 10}}}/>);
|
||||
}
|
||||
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = instance();
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('test backbutton', function () {
|
||||
const wrapper = instance();
|
||||
const func = jest.fn();
|
||||
wrapper.setProps({history: {push: func}});
|
||||
|
||||
expect(func).toHaveBeenCalledTimes(0);
|
||||
wrapper.find('button').simulate('click');
|
||||
expect(func).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user