@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
115 lines (114 loc) • 5.01 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import AttachmentImage from "../AttachmentImage";
import Avatar from '@zohodesk/components/es/Avatar/Avatar';
describe('AttachmentImage', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(AttachmentImage, {
customClass: {
customImageClass: 'customImageClass',
customChildrenClass: 'customChildrenClass'
},
previewObj: {
previewData: [{
id: '1',
name: 'slack0.jpg',
size: '100412',
href: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
viewUrl: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
downloadUrl: 'https://2.bp.blogspot.com/_H-PCzW2K720/SlXXLLMOzsI/AAAAAAAAAFE/efv7GBth9cQ/s280/Elva+Hill+04.JPG',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '2',
name: 'slack1.jpg',
size: '100412',
href: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
viewUrl: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
downloadUrl: 'https://p.bigstockphoto.com/GeFvQkBbSLaMdpKXF1Zv_bigstock-Aerial-View-Of-Blue-Lakes-And--227291596.jpg',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '3',
name: 'slack2.jpg',
size: '100412',
href: 'https://wallpapercave.com/wp/wp3913900.jpg',
viewUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '4',
name: 'slack3.jpg',
size: '100412',
href: '',
viewUrl: '',
downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
thumbnail: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg' // children: <Avatar name='User Image' />
}, {
id: '5',
name: 'slack3.jpg',
size: '100412',
href: '',
viewUrl: '',
downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '6',
name: 'slack4.jpg',
size: '100412',
href: 'https://wallpapercave.com/wp/wp3913900.jpg',
viewUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
downloadUrl: 'https://wallpapercave.com/wp/wp3913900.jpg',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '7',
name: 'slack5.jpg',
size: '100412',
href: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
viewUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
downloadUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Giraffe_2019-07-28.jpg/682px-Giraffe_2019-07-28.jpg',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "User Image"
})
}, {
id: '8',
name: 'slack5.mp3',
size: '100412',
href: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
viewUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
downloadUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
thumbnail: 'https://images.sftcdn.net/images/t_app-icon-m/p/7c80bdc6-a206-40b2-91fd-951c244f3672/3180901960/mp3-tag-editor-edit-music-tags-cover-art-changer-icon.png',
children: 'MP3'
}, {
id: '9',
name: 'slack5.mp3',
size: '100412',
href: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
viewUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
downloadUrl: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
children: 'MP3'
}, {
id: '10',
children: 'custom Text'
}, {
id: '11',
children: /*#__PURE__*/React.createElement(Avatar, {
name: "custom children"
})
}],
selectedIndex: 0
}
}));
expect(asFragment()).toMatchSnapshot();
});
});