mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
fixing js unit tests
This commit is contained in:
parent
e28d314b53
commit
abacfd84da
3 changed files with 0 additions and 31 deletions
|
|
@ -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',
|
||||
' ..',
|
||||
'.. ',
|
||||
'. ',
|
||||
|
|
|
|||
Loading…
Reference in a new issue