@behance/beff
Advanced tools
Comparing version 9.3.6 to 9.3.7
@@ -340,2 +340,7 @@ define([ | ||
var file = this._getFile(id); | ||
if (file.type.indexOf('image') === -1) { | ||
return Promise.resolve(file); | ||
} | ||
var _options = options || {}; | ||
@@ -342,0 +347,0 @@ |
{ | ||
"name": "@behance/beff", | ||
"version": "9.3.6", | ||
"version": "9.3.7", | ||
"description": "Behance Frontend Framework", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -25,2 +25,4 @@ define([ | ||
this._blob = { name: image.name, type: image.mime, data: image.result }; | ||
this._video = { name: image.name, type: 'video/mp4', data: image.result }; | ||
this._audio = { name: image.name, type: 'audio/mp3', data: image.result }; | ||
@@ -41,3 +43,11 @@ this.scaled = [ | ||
FineUploaderBasic.prototype = { | ||
getFile: function() { | ||
getFile: function(id) { | ||
if (id === 'video') { | ||
return this._video; | ||
} | ||
if (id === 'audio') { | ||
return this._audio; | ||
} | ||
return this._blob; | ||
@@ -44,0 +54,0 @@ }, |
@@ -188,2 +188,34 @@ define([ | ||
it('does not fire the processing event on a submit with a video type file', function(done) { | ||
spyOn(this.uploader, 'trigger').and.callThrough(); | ||
this.uploader.on('submit', function() { | ||
var allArgs = this.uploader.trigger.calls.allArgs(); | ||
allArgs.forEach(function(arg) { | ||
expect(arg[0]).not.toEqual('processing'); | ||
}); | ||
done(); | ||
}.bind(this)); | ||
fineuploaderMock.fakeSubmit('video'); | ||
}); | ||
it('does not fire the processing event on a submit with an audio type file', function(done) { | ||
spyOn(this.uploader, 'trigger').and.callThrough(); | ||
this.uploader.on('submit', function() { | ||
var allArgs = this.uploader.trigger.calls.allArgs(); | ||
allArgs.forEach(function(arg) { | ||
expect(arg[0]).not.toEqual('processing'); | ||
}); | ||
done(); | ||
}.bind(this)); | ||
fineuploaderMock.fakeSubmit('audio'); | ||
}); | ||
it('fires the error event with a suitable message on an upload error', function(done) { | ||
@@ -190,0 +222,0 @@ var filename = fineuploaderMock.getFakeImageName(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1571312
14246