forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.js
32 lines (32 loc) · 873 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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');
});
});