fixing js unit tests

This commit is contained in:
Thomas Müller 2015-02-19 11:23:01 +01:00
parent e28d314b53
commit abacfd84da
3 changed files with 0 additions and 31 deletions

View file

@ -102,14 +102,6 @@
} else if (trimmedName.length === 0) {
throw t('files', 'File name cannot be empty.');
}
// check for invalid characters
//var invalidCharacters =
// ['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n'];
//for (var i = 0; i < invalidCharacters.length; i++) {
// if (trimmedName.indexOf(invalidCharacters[i]) !== -1) {
// throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.");
// }
//}
return true;
},
displayStorageWarnings: function() {

View file

@ -110,18 +110,5 @@ describe('OC.Upload tests', function() {
'Not enough free space, you are uploading 5 kB but only 1000 B is left'
);
});
it('does not add file if it has invalid characters', function() {
var result;
testFile.name = 'stars*stars.txt';
result = addFile(testFile);
expect(result).toEqual(false);
expect(failStub.calledOnce).toEqual(true);
expect(failStub.getCall(0).args[1].textStatus).toEqual('invalidcharacters');
expect(failStub.getCall(0).args[1].errorThrown.substr(0, 12)).toEqual(
'Invalid name'
);
});
});
});

View file

@ -55,16 +55,6 @@ describe('OCA.Files.Files tests', function() {
' ',
'.',
'..',
'back\\slash',
'sl/ash',
'lt<lt',
'gt>gt',
'col:on',
'double"quote',
'pi|pe',
'dont?ask?questions?',
'super*star',
'new\nline',
' ..',
'.. ',
'. ',