test: fix index.spec.ts typing (#8201)
This commit is contained in:
@@ -85,7 +85,7 @@ export default createComponent({
|
||||
if (isRange(modelValue)) {
|
||||
return `${((modelValue[0] - Number(min)) * 100) / scope.value}%`;
|
||||
}
|
||||
return `0%`;
|
||||
return '0%';
|
||||
};
|
||||
|
||||
const barStyle = computed<CSSProperties>(() => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
mockGetBoundingClientRect,
|
||||
} from '../../../test';
|
||||
|
||||
function mockRect(vertical) {
|
||||
function mockRect(vertical?: boolean) {
|
||||
return mockGetBoundingClientRect({
|
||||
width: vertical ? 0 : 100,
|
||||
height: vertical ? 100 : 0,
|
||||
@@ -169,18 +169,6 @@ test('should emit "update:modelValue" event after clicking vertical slider', ()
|
||||
expect(wrapper.emitted('update:modelValue').pop()).toEqual([100]);
|
||||
});
|
||||
|
||||
test('should format initial value', (done) => {
|
||||
mount(Slider, {
|
||||
props: {
|
||||
modelValue: null,
|
||||
'onUpdate:modelValue': (value) => {
|
||||
expect(value).toEqual(0);
|
||||
done();
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test('should not emit change event when value not changed', async () => {
|
||||
const wrapper = mount(Slider, {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user