1

so, I’m defining in a selector

const = saveAndExitSelector = createSelector((state:IAppStoreState)=> state.Abc.data, ({abc,xyz,mno}) = ({abc,xyz,mno}) );

After defining it I’m passing it as

Const {abc,xyz,mno} = useSelector(saveAndExitSelector);

Const input = [acb,xyz,mno]

And I’m defining in a button on whose onclick, Im dispatching and event and sending in the input

<Button onClick={()=>actions.dispatchEvent(eventName,input)} Now while running my UT,

I’m unable to cover these lines of code

How can I test this onClick???

I tried mocking it as jest.fn() still no luck

0 Answers0