R9102
R9102

Reputation: 727

Can i check multiple function call using jest/enzyme?

I have onchange callback(been called from child to parent) function in one of the component i was trying to simulate onchange function as shown but i am getting error as 'getchangeChecbox' is not a function

childcomponent

<checkbox
label="checkbox input"
value={checkBoxInitalState}
onChange={e => { toggleCheckbox(e);  selectOption(e?'A':'B') }}

testcase

checkBoxValue.props().onChange(false)
output.update()

Error

toggleCheckbox is not a function

how do i simulate onchange in this scenario?how to check selectoption value(selectoption is a function)

Upvotes: 0

Views: 55

Answers (0)

Related Questions