logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

file_type.spec.js (629B)


  1. import fileType from 'src/services/file_type/file_type.service.js'
  2. describe('fileType service', () => {
  3. describe('fileMatchesSomeType', () => {
  4. it('should be true when file type is one of the listed', () => {
  5. const file = { mimetype: 'audio/mpeg' }
  6. const types = ['video', 'audio']
  7. expect(fileType.fileMatchesSomeType(types, file)).to.eql(true)
  8. })
  9. it('should be false when files type is not included in type list', () => {
  10. const file = { mimetype: 'audio/mpeg' }
  11. const types = ['image', 'video']
  12. expect(fileType.fileMatchesSomeType(types, file)).to.eql(false)
  13. })
  14. })
  15. })