mirror of
https://github.com/strapi/strapi.git
synced 2025-08-11 10:18:28 +00:00
22 lines
520 B
JavaScript
22 lines
520 B
JavaScript
![]() |
const uploadService = require('../Upload');
|
||
|
|
||
|
describe('Upload service', () => {
|
||
|
describe('formatFileInfo', () => {
|
||
|
test('Generates hash', () => {
|
||
|
const fileData = {
|
||
|
filename: 'File Name.png',
|
||
|
type: 'image/png',
|
||
|
size: 1000 * 1000,
|
||
|
};
|
||
|
|
||
|
expect(uploadService.formatFileInfo(fileData)).toMatchObject({
|
||
|
name: 'File Name',
|
||
|
hash: expect.stringContaining('File_Name'),
|
||
|
ext: '.png',
|
||
|
mime: 'image/png',
|
||
|
size: 1000,
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
});
|