Skip to content

Commit

Permalink
[Refactor] ReactWrapper/ShallowWrapper: ensure calling an adapter…
Browse files Browse the repository at this point in the history
…‘s nodeToElement preserves the receiver
  • Loading branch information
ljharb committed Jun 1, 2019
1 parent 65881b2 commit 7986308
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/enzyme/src/ReactWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class ReactWrapper {
* @return {Array<ReactElement>}
*/
getElements() {
return this[NODES].map(getAdapter(this[OPTIONS]).nodeToElement);
return this[NODES].map(n => getAdapter(this[OPTIONS]).nodeToElement(n));
}

// eslint-disable-next-line class-methods-use-this
Expand Down
2 changes: 1 addition & 1 deletion packages/enzyme/src/ShallowWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class ShallowWrapper {
* @return {Array<ReactElement>}
*/
getElements() {
return this.getNodesInternal().map(getAdapter(this[OPTIONS]).nodeToElement);
return this.getNodesInternal().map(n => getAdapter(this[OPTIONS]).nodeToElement(n));
}

// eslint-disable-next-line class-methods-use-this
Expand Down

0 comments on commit 7986308

Please sign in to comment.