Skip to content

Commit

Permalink
Fix getComponentProp crashing for text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
valscion committed Feb 18, 2019
1 parent fe127cc commit 41dada7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chai-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
} else {
return component.getAttribute(prop);
}
} else if (component.nodeType === Node.TEXT_NODE) {
// Skip text nodes as they don't have any props
} else {
return component.props[prop];
}
Expand Down

0 comments on commit 41dada7

Please sign in to comment.