Skip to content
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

[New] shallow: setProps: add callback argument #1721

Merged
merged 2 commits into from
Jul 22, 2018

Conversation

emuraton
Copy link
Contributor

@emuraton emuraton commented Jul 22, 2018

Fixes #1716

@emuraton emuraton changed the base branch from master to setProps July 22, 2018 00:18
@@ -1272,10 +1272,8 @@ describe('shallow', () => {
expect(wrapper.find('.foo')).to.have.lengthOf(1);

wrapper[sym('__renderer__')].batchedUpdates(() => {
wrapper.setProps({ id: 'bar', foo: 'bla' }, () => {
expect(wrapper.find('.bar')).to.have.lengthOf(1);
});
Copy link
Contributor Author

@emuraton emuraton Jul 22, 2018

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

Copy link
Member

@ljharb ljharb Jul 22, 2018

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

Copy link
Contributor Author

@emuraton emuraton Jul 22, 2018

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 👍

@ljharb ljharb changed the title Issue 1716 fix test [New] shallow: setProps: add callback argument Jul 22, 2018
@ljharb ljharb added the semver: minor New stuff. label Jul 22, 2018
@ljharb ljharb changed the base branch from setProps to master July 22, 2018 21:46
Copy link
Member

@ljharb ljharb left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants