feat(empty): add imag-size prop (#7389)

This commit is contained in:
neverland
2020-10-22 15:46:05 +08:00
committed by GitHub
parent 3664659240
commit abbf448a43
7 changed files with 38 additions and 9 deletions
+17
View File
@@ -40,3 +40,20 @@ test('render svg when image is network', () => {
expect(wrapper).toMatchSnapshot();
});
test('image-size prop', () => {
const wrapper = mount(Empty, {
propsData: {
imageSize: 50,
},
});
const image = wrapper.find('.van-empty__image').element;
expect(image.style.width).toEqual('50px');
expect(image.style.height).toEqual('50px');
wrapper.setProps({ imageSize: '1vw' });
expect(image.style.width).toEqual('1vw');
expect(image.style.height).toEqual('1vw');
});