mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[new feature] Uploader: support click to preview image (#3603)
This commit is contained in:
@@ -257,3 +257,24 @@ it('delete preview image', async () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(wrapper.emitted('delete')[0]).toBeTruthy();
|
||||
});
|
||||
|
||||
it('click to preview image', async () => {
|
||||
const wrapper = mount(Uploader, {
|
||||
propsData: {
|
||||
fileList: [],
|
||||
previewSize: 30
|
||||
},
|
||||
listeners: {
|
||||
input(fileList) {
|
||||
wrapper.setProps({ fileList });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
wrapper.vm.onChange(file);
|
||||
await later();
|
||||
|
||||
wrapper.find('.van-image').trigger('click');
|
||||
|
||||
expect(document.querySelector('.van-image-preview')).toBeTruthy();
|
||||
});
|
||||
|
Reference in New Issue
Block a user