This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed: iOS camera input gives the same filename to all files causing …
…files to overwrite each other kobotoolbox/enketo-express#374
- Loading branch information
Showing
7 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* In a future version of PhantomJS with DOMParser support for Blobs, these tests can move to the regular spec. | ||
*/ | ||
|
||
var utils = require( '../../src/js/utils' ); | ||
|
||
describe( 'return postfixed filenames', function() { | ||
|
||
[ | ||
[ 'myname', '-mypostfix', 'myname-mypostfix' ], | ||
[ 'myname.jpg', '-mypostfix', 'myname-mypostfix.jpg' ], | ||
[ 'myname.dot.jpg', '-mypostfix', 'myname.dot-mypostfix.jpg' ], | ||
[ 'myname.000', '-mypostfix', 'myname-mypostfix.000' ], | ||
[ undefined, 'mypostfix', '' ], | ||
[ null, 'mypostfix', '' ], | ||
[ false, 'mypostfix', '' ], | ||
[ 'myname', undefined, 'myname' ], | ||
[ 'myname', null, 'myname' ], | ||
[ 'myname', false, 'myname' ] | ||
].forEach( function( test ) { | ||
var file = new Blob( [ 'a' ], { | ||
type: 'text' | ||
} ); | ||
file.name = test[ 0 ]; | ||
var postfix = test[ 1 ]; | ||
var expected = test[ 2 ]; | ||
|
||
it( 'returns the filename ' + expected + ' from ' + file.name + ' and ' + postfix, function() { | ||
expect( utils.getFilename( file, postfix ) ).toEqual( expected ); | ||
} ); | ||
} ); | ||
} ); |