Commit abacfd84 authored by Thomas Müller's avatar Thomas Müller
Browse files

fixing js unit tests

parent e28d314b
......@@ -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() {
......
......@@ -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'
);
});
});
});
......@@ -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',
' ..',
'.. ',
'. ',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment