Closed lifehackett closed 7 years ago
You can review thousands of lines of dropdown tests for examples here 😄 https://github.com/Semantic-Org/Semantic-UI-React/blob/master/test/specs/modules/Dropdown/Dropdown-test.js
const nativeEvent = { nativeEvent: { stopImmediatePropagation: _.noop } }
// ...later
.simulate('click', nativeEvent)
:hanging_head_in_shame:
Sorry, not sure how I missed that. I focused on dropdown-item.test.js
Thanks for humoring me none-the-less
Steps
I have a MutiSelect implementation of Dropdown that I am writing unit tests for and when I simulate the change event for it I get
Source: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/modules/Dropdown/Dropdown.js#L653
I am using Enzyme which is a simple wrapper around ReactTestUtils who's docs seem to indicate that it only supports the Synthentic Event
I looked through your tests/issues, stackoverflow, JSDom, ReactTestUtils, and Enzyme to try to understand how to mock the nativeEvent, but couldn't find the solution. Any thoughts?
(Apologies, as I know this sort of spans multiple OS repos, but thought since your tests are passing that you would have solved this)
Expected Result
Test passes
Actual Result
Version
0.63.5