using react with typescript, jest and enzyme. trying to unitest a functional component, which has an object as parameter:
const JobListItem: React.FC<{ job: IJob }> = ({ job }) => {
in my test - this is how i try to setup the component:
const setup = (props={ }) => {
const wrapper = shallow(<JobListItem<{ job: IJob }> {...props} />)
return wrapper;
}
with simpler components (which don't have the IJob - just props) the setup works with this syntax:
const setup = (props={}) => {
const wrapper = shallow(<JobList {...props} />)
return wrapper;
}
what am i missing? how can i pass the "IJob" to the shallow? the error i'm receiving is:
(property) job: IJob expected 0 type arguments but got 1