test: fix index.spec.ts typing (#8201)

This commit is contained in:
neverland
2021-02-23 19:43:29 +08:00
committed by GitHub
parent f0f89f1c4c
commit 1170262d72
12 changed files with 34 additions and 45 deletions
+1 -1
View File
@@ -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>(() => {
+1 -13
View File
@@ -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: {