make tags deleteable

seperate sidebar for each different category page
This commit is contained in:
2021-01-26 19:14:57 +00:00
parent d8aee9e5b7
commit ac126f6a9d
12 changed files with 266 additions and 183 deletions

View 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);
});
});