types: test cases typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test';
|
||||
import Loading from '..';
|
||||
|
||||
test('should change loading size when using size prop', () => {
|
||||
@@ -8,7 +8,7 @@ test('should change loading size when using size prop', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const spinner = wrapper.find('.van-loading__spinner').element;
|
||||
const spinner = wrapper.find('.van-loading__spinner');
|
||||
expect(spinner.style.width).toEqual('20px');
|
||||
expect(spinner.style.height).toEqual('20px');
|
||||
});
|
||||
@@ -23,9 +23,7 @@ test('should change text font-size when using text-size prop', () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.van-loading__text').element.style.fontSize).toEqual(
|
||||
'20px'
|
||||
);
|
||||
expect(wrapper.find('.van-loading__text').style.fontSize).toEqual('20px');
|
||||
});
|
||||
|
||||
test('should change text color when using text-color prop', async () => {
|
||||
@@ -38,7 +36,7 @@ test('should change text color when using text-color prop', async () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.van-loading__text').element.style.color).toBe('red');
|
||||
expect(wrapper.find('.van-loading__text').style.color).toBe('red');
|
||||
});
|
||||
|
||||
test('should change text color when using color prop', async () => {
|
||||
@@ -51,7 +49,7 @@ test('should change text color when using color prop', async () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.van-loading__text').element.style.color).toBe('green');
|
||||
expect(wrapper.find('.van-loading__text').style.color).toBe('green');
|
||||
});
|
||||
|
||||
test('should change text color to textColor when using color & textColor prop', async () => {
|
||||
@@ -65,5 +63,5 @@ test('should change text color to textColor when using color & textColor prop',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.van-loading__text').element.style.color).toBe('red');
|
||||
expect(wrapper.find('.van-loading__text').style.color).toBe('red');
|
||||
});
|
||||
Reference in New Issue
Block a user