[new feature] Uploader: add preview prop

This commit is contained in:
陈嘉涵
2019-06-04 15:16:11 +08:00
parent 39339fdda7
commit 03af04e81e
9 changed files with 140 additions and 26 deletions

View File

@@ -113,3 +113,26 @@ test('file size overlimit', async () => {
await later();
expect(wrapper.emitted('oversize')[2]).toBeFalsy();
});
it('render upload-text', () => {
const wrapper = mount(Uploader, {
propsData: {
uploadText: 'Text'
}
});
expect(wrapper).toMatchSnapshot();
});
it('render preview image', async () => {
const wrapper = mount(Uploader, {
propsData: {
preview: true
}
});
wrapper.vm.onChange(file);
await later();
expect(wrapper).toMatchSnapshot();
});