feat(Image): add icon-size prop (#8395)

This commit is contained in:
neverland
2021-03-23 17:15:08 +08:00
committed by GitHub
parent 49430a1ef6
commit 6d428345d7
4 changed files with 31 additions and 1 deletions
+24
View File
@@ -137,6 +137,30 @@ test('should change border radius when using border-radius prop', () => {
expect(wrapper.style.borderRadius).toEqual('3px');
});
test('should change loading icon size when using icon-size prop', () => {
const wrapper = mount(VanImage, {
props: {
iconSize: '3rem',
loadingIcon: 'success',
},
});
expect(wrapper.find('.van-image__loading-icon').style.fontSize).toEqual(
'3rem'
);
});
test('should change error icon size when using icon-size prop', async () => {
const wrapper = mount(VanImage, {
props: {
src: IMAGE_URL,
iconSize: '3rem',
errorIcon: 'error',
},
});
await wrapper.find('img').trigger('error');
expect(wrapper.find('.van-image__error-icon').style.fontSize).toEqual('3rem');
});
test('should render default slot correctly', () => {
const wrapper = mount(VanImage, {
props: {