-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With event
does not override currentTarget
#69
Comments
The documentation is actually this link: http://bruderstein.github.io/unexpected-react/assertions/RenderedReactElement/with-event/ - this also should be made clearer, not every property can be overridden. It uses react-dom/test-utils Simulate so not all properties are overridable - |
Hi Dave
I was curious, have you ever looked at what it would take for unexpectedreact to work on snabbdom? Do you have any thoughts about this?
Thank you
Brian
|
@bmhardy No (I had to Google snabbdom), but it's actually straightforward, as all the real work is in unexpected-htmllike, and then there is just adapters for react elements, DOM elements and things like snapshot elements. See unexpected-preact for example of implementing it for another virtual DOM implementation. (Next time, it would be better to open a new issue rather than commenting on an unrelated issue) |
I see. Now I wonder what the unexpected-react equivalent of this test-utils example is: // <input ref={(node) => this.textInput = node} />
const node = this.textInput;
node.value = 'giraffe';
ReactTestUtils.Simulate.change(node); |
I expected this to pass:
But it failed with this:
Does this maybe mean the deep renderer does not allow triggering events with arbitrary properties? The documentation suggests that it should be possible..
The text was updated successfully, but these errors were encountered: