|
@@ -137,6 +137,15 @@ describe('Slider', () => {
|
|
|
expect(wrapper.exists(`.${BASE_CLASS_PREFIX}-slider-dot`)).toBe(true);
|
|
|
});
|
|
|
|
|
|
+ it('marks clickable', () => {
|
|
|
+ const STYLE = { width: 100, height: 32 }; // it is really hack to mock slider wrapper getBoundingClientRect data
|
|
|
+ let slider = mount(<Slider style={STYLE} marks={{ 20: '20c', 40: '40c' }} defaultValue={[0, 100]} range />);
|
|
|
+ expect(slider.exists(`.${BASE_CLASS_PREFIX}-slider-dot`)).toBe(true);
|
|
|
+ expect(slider.state('currentValue')).toEqual([0, 100])
|
|
|
+ slider.find(`.${BASE_CLASS_PREFIX}-slider-dot`).at(0).simulate('click', {pageX: 20 })
|
|
|
+ expect(slider.state('currentValue')).toEqual([20, 100])
|
|
|
+ });
|
|
|
+
|
|
|
it('when tooltipVisible is true, tooltip should show always, or should never show', () => {
|
|
|
let wrapper = mount(<Slider defaultValue={30} tooltipVisible />);
|
|
|
expect(wrapper.exists(`.${BASE_CLASS_PREFIX}-tooltip-wrapper`)).toBe(true);
|