summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-19 17:19:28 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-19 18:21:42 +0200
commit8ae2468345d5c5a090098a7477121f71992abaa0 (patch)
tree650b35b1928a3148de2150204ab2c5fc22a4cef8 /apps/files/tests
parent9ef7410abe282e2a81a9cd41672574a74282e4c3 (diff)
downloadnextcloud-server-8ae2468345d5c5a090098a7477121f71992abaa0.tar.gz
nextcloud-server-8ae2468345d5c5a090098a7477121f71992abaa0.zip
Fix appending of rows after upload
When uploading files or folders, they only need to be appended or updated when their path or a section of their path is inside the current directory (which happens for folder upload) Fixes issue where file was appended when dragging on a parent directory onto the breadcrumb. Fixes appending issue when uploading folders.
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js26
1 files changed, 2 insertions, 24 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 7d3bc946dd3..011e73d4b30 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1730,20 +1730,6 @@ describe('OCA.Files.FileList tests', function() {
return ev;
}
- /**
- * Convert form data to a flat list
- *
- * @param formData form data array as used by jquery.upload
- * @return map based on the array's key values
- */
- function decodeFormData(data) {
- var map = {};
- _.each(data.formData(), function(entry) {
- map[entry.name] = entry.value;
- });
- return map;
- }
-
beforeEach(function() {
// simulate data structure from jquery.upload
uploadData = {
@@ -1803,11 +1789,7 @@ describe('OCA.Files.FileList tests', function() {
ev = dropOn(fileList.findFileEl('somedir').find('td:eq(2)'), uploadData);
expect(ev.result).not.toEqual(false);
- expect(uploadData.formData).toBeDefined();
- formData = decodeFormData(uploadData);
- expect(formData.dir).toEqual('/subdir/somedir');
- expect(formData.file_directory).toEqual('fileToUpload.txt');
- expect(formData.requesttoken).toBeDefined();
+ expect(uploadData.targetDir).toEqual('/subdir/somedir');
});
it('drop on a breadcrumb inside the table triggers upload to target folder', function() {
var ev, formData;
@@ -1815,11 +1797,7 @@ describe('OCA.Files.FileList tests', function() {
ev = dropOn(fileList.$el.find('.crumb:eq(2)'), uploadData);
expect(ev.result).not.toEqual(false);
- expect(uploadData.formData).toBeDefined();
- formData = decodeFormData(uploadData);
- expect(formData.dir).toEqual('/a/b');
- expect(formData.file_directory).toEqual('fileToUpload.txt');
- expect(formData.requesttoken).toBeDefined();
+ expect(uploadData.targetDir).toEqual('/a/b');
});
});
});