aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2019-01-30 18:58:08 +0000
committerlambda <pleromagit@rogerbraun.net>2019-01-30 18:58:08 +0000
commit5b7b1dfebc37bd5db4e839973062b452b02c898d (patch)
treea517e4942725286b173b685cbe87bc6c7878b66e /test/unit
parentb1facdf7ad54436c2afde7c28c917cda87a5b7e3 (diff)
parentc7cffbb6c70bbb21cf787d96e82e0261427b9234 (diff)
Merge branch 'feat/media-modal' into 'develop'
modal for viewing attachments in-tab See merge request pleroma/pleroma-fe!468
Diffstat (limited to 'test/unit')
-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)
+ })
+ })
+})