Skip to content

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

Merged
ljharb merged 2 commits into
enzymejs:masterfrom
emuraton:setProps-fix-test
Jul 22, 2018
Merged

ljharb merged 2 commits into
enzymejs:masterfrom
emuraton:setProps-fix-test

Conversation

@emuraton

@emuraton emuraton commented Jul 22, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #1716

@emuraton
emuraton changed the base branch from master to setProps July 22, 2018 00:18
wrapper[sym('__renderer__')].batchedUpdates(() => {
wrapper.setProps({ id: 'bar', foo: 'bla' }, () => {
expect(wrapper.find('.bar')).to.have.lengthOf(1);
});

@emuraton emuraton Jul 22, 2018 •

Copy link
Copy Markdown
Contributor Author

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

@ljharb ljharb Jul 22, 2018 •

Copy link
Copy Markdown
Member

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

@emuraton emuraton Jul 22, 2018 •

Copy link
Copy Markdown
Contributor Author

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 👍

@emuraton
emuraton force-pushed the setProps-fix-test branch from e9e6e58 to 263bd2e Compare July 22, 2018 00:22
@emuraton
emuraton force-pushed the setProps-fix-test branch from bd296ef to eba0ebc Compare July 22, 2018 14:03
@ljharb
ljharb force-pushed the setProps-fix-test branch from eba0ebc to 34d69ce Compare July 22, 2018 21:16
@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

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

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.

2 participants