ant-design-vue/components/image/__tests__/index.test.js
Zou Jian 5913cf9c5c
feat: add image (#3235)
* feat: 🆕 image组件 - 添加样式

* feat: 🆕 增加 AImage 组件

* feat: 🆕 参考 ant-design 增加 相关 Image 组件的less定义

* feat: 🆕 Image placeholder 的修改

* fix: 🐞 去除 onPreviewClose 相关

* test: 🧪 image width/height 以及相关测试

* fix: 🐞 fix lint no-setup-props-destructure

* test: 🧪 image test snap file

* refactor: 💡 去掉多加了的文件,重构文件以使逻辑清晰

* feat: 🆕 rc-image 相关内容 列入 vc-image 文件夹中

* feat: 🆕 antd 4.9.1 增加 image-preview-group

* feat: 🆕 add ImagePropsType

* feat: udpate image components

* feat: update image

* feat: update image

Co-authored-by: tanjinzhou <415800467@qq.com>
2020-12-18 18:02:51 +08:00

33 lines
873 B
JavaScript

import Image from '..';
import mountTest from '../../../tests/shared/mountTest';
import { mount } from '@vue/test-utils';
describe('Image', () => {
mountTest(Image);
it('image size', () => {
const wrapper = mount({
render() {
return (
<Image
width="200px"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
);
},
});
expect(wrapper.find('.ant-image').element.style.width).toBe('200px');
});
it('image size number', () => {
const wrapper = mount({
render() {
return (
<Image
width={200}
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
);
},
});
expect(wrapper.find('.ant-image').element.style.width).toBe('200px');
});
});