aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2019-01-26 17:45:03 +0200
committershpuld <shp@cock.li>2019-01-26 17:45:03 +0200
commit3978aaef84cc023908155343af76983f2715cf90 (patch)
tree0776b181029151d45450e472d1540715040bcab0 /test
parent8761e039d04ff26944c87339ef55d2951a42696c (diff)
Redo everything in the MR
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/services/file_type/file_type.spec.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/specs/services/file_type/file_type.spec.js b/test/unit/specs/services/file_type/file_type.spec.js
new file mode 100644
index 00000000..eb8a087d
--- /dev/null
+++ b/test/unit/specs/services/file_type/file_type.spec.js
@@ -0,0 +1,19 @@
+import fileType from 'src/services/file_type/file_type.service.js'
+
+describe('fileType service', () => {
+ describe('fileMatchesSomeType', () => {
+ it('should be true when file type is one of the listed', () => {
+ const file = { mimetype: 'audio/mpeg' }
+ const types = ['video', 'audio']
+
+ expect(fileType.fileMatchesSomeType(types, file)).to.eql(true)
+ })
+
+ it('should be false when files type is not included in type list', () => {
+ const file = { mimetype: 'audio/mpeg' }
+ const types = ['image', 'video']
+
+ expect(fileType.fileMatchesSomeType(types, file)).to.eql(false)
+ })
+ })
+})