Skip to content

Commit

Permalink
fix snapshot testing with storyshots, enzyme, react-test-renderer
Browse files Browse the repository at this point in the history
Fixes #338
  • Loading branch information
STRML committed Nov 27, 2017
1 parent a63d627 commit c1f04b9
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 c1f04b9

Please sign in to comment.