Skip to content

Commit

Permalink
[Slider] fix failing handler test
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Aug 15, 2018
1 parent 50c656b commit dae017d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/material-ui-lab/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ class Slider extends React.Component {
style={inlineThumbStyles}
onBlur={this.handleBlur}
onKeyDown={this.handleKeyDown}
onMouseDown={this.handleMouseDown}
onTouchStartCapture={this.handleTouchStart}
onTouchMove={this.handleMouseMove}
onFocusVisible={this.handleFocus}
Expand Down
8 changes: 5 additions & 3 deletions packages/material-ui-lab/src/Slider/Slider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ describe('<Slider />', () => {
value={0}
/>,
);
const button = wrapper.find('button');

wrapper.simulate('click');
button.simulate('mousedown');
button.simulate('mouseup');
wrapper.simulate('mousedown');
// document.simulate('mouseup')
const mouseupEvent = document.createEvent('HTMLEvents');
mouseupEvent.initEvent('mouseup', false, true);
document.dispatchEvent(mouseupEvent);

assert.strictEqual(handleChange.callCount, 1, 'should have called the handleChange cb');
assert.strictEqual(handleDragStart.callCount, 1, 'should have called the handleDragStart cb');
Expand Down

0 comments on commit dae017d

Please sign in to comment.