feat(Uploader): add preview-options prop (#6810)

This commit is contained in:
neverland
2020-07-18 17:36:37 +08:00
committed by GitHub
parent b1460ce42e
commit 6c744d7531
4 changed files with 22 additions and 1 deletions
+17
View File
@@ -406,6 +406,23 @@ test('click to preview image', async () => {
expect(images.length).toEqual(1);
});
test('preview-options prop', async () => {
const wrapper = mount(Uploader, {
propsData: {
fileList: [{ url: IMAGE }],
previewOptions: {
closeable: true,
},
},
});
wrapper.find('.van-image').trigger('click');
await later();
const closeIcon = document.querySelectorAll('.van-image-preview__close-icon');
expect(closeIcon.length).toEqual(1);
});
test('closeImagePreview method', () => {
const close = jest.fn();
const wrapper = mount(Uploader, {