make tags deleteable
seperate sidebar for each different category page
This commit is contained in:
28
src/elements/Popups/SubmitPopup/SubmitPopup.test.js
Normal file
28
src/elements/Popups/SubmitPopup/SubmitPopup.test.js
Normal file
@ -0,0 +1,28 @@
|
||||
import {shallow} from "enzyme";
|
||||
import React from "react";
|
||||
import SubmitPopup from "./SubmitPopup";
|
||||
|
||||
describe('<SubmitPopup/>', function () {
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = shallow(<SubmitPopup/>);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('test submit click', function () {
|
||||
const func = jest.fn();
|
||||
const wrapper = shallow(<SubmitPopup submit={() => func()}/>);
|
||||
|
||||
wrapper.find('Button').findWhere(p => p.props().title === 'Submit').simulate('click');
|
||||
|
||||
expect(func).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('test cancel click', function () {
|
||||
const func = jest.fn();
|
||||
const wrapper = shallow(<SubmitPopup onHide={() => func()}/>);
|
||||
|
||||
wrapper.find('Button').findWhere(p => p.props().title === 'Cancel').simulate('click');
|
||||
|
||||
expect(func).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user