Skip to content

Invoke() api#1856

Merged
ljharb merged 3 commits intoenzymejs:masterfrom
koba04:invoke-api
Apr 6, 2019
Merged

Invoke() api#1856
ljharb merged 3 commits intoenzymejs:masterfrom
koba04:invoke-api

Conversation

@koba04
Copy link
Copy Markdown
Contributor

@koba04 koba04 commented Oct 8, 2018

This PR is to pick up from #945
If @milesj is still working on #945, feel free to close this!

@milesj
Copy link
Copy Markdown
Contributor

milesj commented Oct 9, 2018

I haven't had time to work on my PR, so thanks for this!

@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Oct 19, 2018

@woutervanvliet Thank you for your reviews! I've fixed them.

Copy link
Copy Markdown
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.

This will need a full rebase - not just a merge - on latest master.

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Mar 7, 2019

@koba04 ping, still interested in this?

@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Mar 7, 2019

@ljharb OK, I'll work on it again!

@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Mar 7, 2019

I've recreated the branch from master.
Next, I'll adress #1856 (comment)

@koba04 koba04 force-pushed the invoke-api branch 2 times, most recently from 1eecdaf to 5e28ce4 Compare March 9, 2019 14:59
@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Mar 10, 2019

@ljharb I’ve addressed you comment and rebased this!

}
return (...args) => {
const response = handler.apply(this, args);
this[ROOT].update();
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.

why is this needed?

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.

@ljharb
The purpose is to reflect the updates into the ShallowWrapper instance if the handler calls setState.

It's the same as what simulate() is doing.

https://github.com/airbnb/enzyme/blob/master/packages/enzyme/src/ShallowWrapper.js#L999

But I've covered the most case by this PR so this might be unnecessary.

#1499

}
return (...args) => {
const response = handler.apply(this, args);
this[ROOT].update();
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.

ditto

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Apr 6, 2019

I'm not sure what's going on with coverage there; I'm going to merge anyways.

@ljharb ljharb merged commit 31c33e5 into enzymejs:master Apr 6, 2019
@koba04 koba04 deleted the invoke-api branch April 8, 2019 14:38
@koba04
Copy link
Copy Markdown
Contributor Author

koba04 commented Apr 8, 2019

Thanks!

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.

4 participants