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

[enzyme-adapter-react-16] [New] `mount`: add `hydrateIn` option #1707

Merged
merged 1 commit into from Jul 7, 2018

Conversation

Projects
None yet
3 participants
@ljharb
Copy link
Member

commented Jul 6, 2018

Fixes #1316

Reviewers: please help ensure that the following scenarios will work after this PR:

  • new enzyme + new adapter
  • new enzyme + old adapter
  • old enzyme + new adapter

@ljharb ljharb force-pushed the hydrate branch from 70f50e6 to ee180af Jul 6, 2018

@brucewpaul
Copy link
Contributor

left a comment

One question, but either way 👍

@@ -21,9 +21,25 @@ export function getAdapter(options = {}) {
}

export function makeOptions(options) {
const { attachTo, hydrateIn } = options;

if (attachTo && hydrateIn && attachTo !== hydrateIn) {

This comment has been minimized.

Copy link
@brucewpaul

brucewpaul Jul 6, 2018

Contributor

would there ever be a case when both are present? Do we just want to not allow this and then hydrate -> attach on pre16 versions?

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 7, 2018

Author Member

So, I’ve normalized the options here - which means it will end up having both the best time it hits this code path. So altho users really shouldn’t supply both, i cant think of how to differentiate between user options and things passed in via shallow calls or adapter options etc.

@ljharb ljharb merged commit ee180af into master Jul 7, 2018

1 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ljharb ljharb deleted the hydrate branch Jul 7, 2018

ljharb added a commit that referenced this pull request Aug 8, 2018

[enzyme-adapter-react-16] v1.2.0
 - [new] add `isFragment` (#1733)
 - [new] Add `displayNameOfNode`, `isValidElementType`
 - [new] `mount`: add `hydrateIn` option (#1317, #1707)
 - [new] Add support for react context element types (#1513)
 - [new] `shallow`: Add getSnapshotBeforeUpdate support (#1657)
 - [fix] portals and roots may render fragments (#1733)
 - [fix] add missing support for animation events (#1569)
 - [fix] `shallow`: SFCs do not get a `this` (#1703)
 - [refactor]: add “lifecycles” adapter option (#1696)
 - [fix] call ref for a root element (#1541)
 - [fix] Allow empty strings as key props (#1524)
 - [fix] Fix ShallowWrapper for array-rendering components (#1498)
 - [refactor] use `react-is` package
 - [meta] ensure a license and readme is present in all packages when published
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.