bind enter events as a submit to Popups

add s as key to submit a reshuffle in shuffled videos
This commit is contained in:
2021-01-28 19:50:26 +00:00
parent f06da8044f
commit fa21ba4f25
10 changed files with 146 additions and 26 deletions

View File

@ -74,4 +74,16 @@ describe('<AddActorPopup/>', function () {
expect(wrapper.find('PopupBase').find('ActorTile')).toHaveLength(0);
});
it('test Enter submit if only one element left', function () {
const wrapper = shallow(<AddActorPopup/>);
callAPIMock({});
wrapper.setState({actors: [{name: 'test', actor_id: 1}]});
wrapper.find('PopupBase').props().ParentSubmit();
expect(callAPI).toHaveBeenCalledTimes(1);
});
});