fix some tests
fix merge issues
This commit is contained in:
@ -40,12 +40,12 @@ describe('<AddActorPopup/>', function () {
|
||||
|
||||
it('simulate actortile click', function () {
|
||||
const func = jest.fn();
|
||||
const wrapper = shallow(<AddActorPopup onHide={() => {func()}}/>);
|
||||
const wrapper = shallow(<AddActorPopup onHide={() => {func();}} movie_id={1}/>);
|
||||
|
||||
global.callAPIMock({result: 'success'});
|
||||
|
||||
wrapper.setState({actors: [{id: 1, actorname: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').props().onClick();
|
||||
wrapper.setState({actors: [{actor_id: 1, actorname: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').dive().simulate('click');
|
||||
|
||||
expect(callAPI).toHaveBeenCalledTimes(1);
|
||||
|
||||
@ -55,12 +55,12 @@ describe('<AddActorPopup/>', function () {
|
||||
|
||||
it('test failing actortile click', function () {
|
||||
const func = jest.fn();
|
||||
const wrapper = shallow(<AddActorPopup onHide={() => {func()}}/>);
|
||||
const wrapper = shallow(<AddActorPopup onHide={() => {func();}}/>);
|
||||
|
||||
global.callAPIMock({result: 'nosuccess'});
|
||||
|
||||
wrapper.setState({actors: [{id: 1, actorname: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').props().onClick();
|
||||
wrapper.setState({actors: [{actor_id: 1, actorname: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').dive().simulate('click');
|
||||
|
||||
expect(callAPI).toHaveBeenCalledTimes(1);
|
||||
|
||||
@ -68,4 +68,10 @@ describe('<AddActorPopup/>', function () {
|
||||
expect(func).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('test no actor on loading', function () {
|
||||
const wrapper = shallow(<AddActorPopup/>);
|
||||
|
||||
expect(wrapper.find('PopupBase').find('ActorTile')).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user