-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[New] shallow: setProps: add callback argument
#1721
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
Conversation
| wrapper[sym('__renderer__')].batchedUpdates(() => { | ||
| wrapper.setProps({ id: 'bar', foo: 'bla' }, () => { | ||
| expect(wrapper.find('.bar')).to.have.lengthOf(1); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think callback argument is not supported for ShallowRendering
https://github.com/airbnb/enzyme/blob/master/packages/enzyme/src/ShallowWrapper.js#L381
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, but it probably should be - so that it's the same as mount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll update it 👍
e9e6e58 to
263bd2e
Compare
bd296ef to
eba0ebc
Compare
eba0ebc to
34d69ce
Compare
shallow: setProps: add callback argument
ljharb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great!
Fixes #1716