fix(Slider): should format initial value (#4337)
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import Slider from '..';
|
||||
import { mount, trigger, triggerDrag, mockGetBoundingClientRect } from '../../../test/utils';
|
||||
import {
|
||||
mount,
|
||||
trigger,
|
||||
triggerDrag,
|
||||
mockGetBoundingClientRect
|
||||
} from '../../../test/utils';
|
||||
|
||||
function mockRect(vertical) {
|
||||
return mockGetBoundingClientRect({
|
||||
@@ -134,3 +139,17 @@ it('should not emit change event when value not changed', () => {
|
||||
|
||||
expect(wrapper.emitted('change').length).toEqual(1);
|
||||
});
|
||||
|
||||
it('should format initial value', done => {
|
||||
mount(Slider, {
|
||||
propsData: {
|
||||
value: null
|
||||
},
|
||||
listeners: {
|
||||
input(value) {
|
||||
expect(value).toEqual(0);
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user