You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
492 B
13 lines
492 B
import { describe, expect, it } from '@jest/globals'
|
|
import dataURItoFile from './dataURItoFile.js'
|
|
import sampleImageDataURI from './sampleImageDataURI.js'
|
|
|
|
describe('dataURItoFile', () => {
|
|
it('should convert a data uri to a file', () => {
|
|
const file = dataURItoFile(sampleImageDataURI, { name: 'foo.jpg' })
|
|
expect(file instanceof File).toEqual(true)
|
|
expect(file.size).toEqual(9348)
|
|
expect(file.type).toEqual('image/jpeg')
|
|
expect(file.name).toEqual('foo.jpg')
|
|
})
|
|
})
|
|
|