Suppose I have the code below:
<Menu>
<MenuTrigger text='Select action' />
<MenuOptions>
<MenuOption onSelect={() => funcOne()} text='Call funcOne' />
<MenuOption onSelect={() => funcTwo()} text='Call funcTwo' />
</MenuOptions>
</Menu>
Now how to unit test (using enzyme) whether the onSelect
of first MenuOption
calls funcOne
and the onSelect
of the second MenuOption
calls funcTwo
?
The testing example in the doc wasn't very helpful as there's no example related to checking the behavior.