mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
[improvement] Uploader: support preview network image (#3899)
This commit is contained in:
14
src/uploader/test/utils.spec.js
Normal file
14
src/uploader/test/utils.spec.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { isImageFile } from '../utils';
|
||||
|
||||
test('isImageFile', () => {
|
||||
expect(isImageFile({ url: 'https://a.jpg' })).toBeTruthy();
|
||||
expect(isImageFile({ url: 'https://a.jpeg' })).toBeTruthy();
|
||||
expect(isImageFile({ url: 'https://a.png' })).toBeTruthy();
|
||||
expect(isImageFile({ url: 'https://a.svg' })).toBeTruthy();
|
||||
expect(isImageFile({ url: 'https://a.gif' })).toBeTruthy();
|
||||
expect(isImageFile({ file: { type: 'image/jpg' } })).toBeTruthy();
|
||||
expect(isImageFile({ file: { type: 'application/pdf' } })).toBeFalsy();
|
||||
expect(isImageFile({ content: 'data:image/xxx' })).toBeTruthy();
|
||||
expect(isImageFile({ content: 'data:application/xxx' })).toBeFalsy();
|
||||
expect(isImageFile({})).toBeFalsy();
|
||||
});
|
Reference in New Issue
Block a user