Skip to content

Commit

Permalink
Merge pull request #370 from STRML/master
Browse files Browse the repository at this point in the history
fix snapshot testing with storyshots, enzyme, react-test-renderer
  • Loading branch information
yesmeck committed Dec 1, 2017
2 parents a63d627 + c1f04b9 commit 18cff37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/createSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export default function createSlider(Component) {
}

componentDidMount() {
this.document = this.sliderRef.ownerDocument;
// Snapshot testing cannot handle refs, so be sure to null-check this.
this.document = this.sliderRef && this.sliderRef.ownerDocument;
}

onMouseDown = (e) => {
Expand Down

0 comments on commit 18cff37

Please sign in to comment.