diff --git a/apps/comments/tests/js/commentscollectionSpec.js b/apps/comments/tests/js/commentscollectionSpec.js index 2f41a272f676..9427f1e56034 100644 --- a/apps/comments/tests/js/commentscollectionSpec.js +++ b/apps/comments/tests/js/commentscollectionSpec.js @@ -23,7 +23,7 @@ describe('OCA.Comments.CommentCollection', function() { actorId: 'user1', actorDisplayName: 'User One', objectType: 'files', - objectId: 5, + objectId: '5', message: 'First', creationDateTime: Date.UTC(2016, 1, 3, 10, 5, 0) }; @@ -33,7 +33,7 @@ describe('OCA.Comments.CommentCollection', function() { actorId: 'user2', actorDisplayName: 'User Two', objectType: 'files', - objectId: 5, + objectId: '5', message: 'Second\nNewline', creationDateTime: Date.UTC(2016, 1, 3, 10, 0, 0) }; @@ -43,7 +43,7 @@ describe('OCA.Comments.CommentCollection', function() { actorId: 'user3', actorDisplayName: 'User Three', objectType: 'files', - objectId: 5, + objectId: '5', message: 'Third', creationDateTime: Date.UTC(2016, 1, 3, 5, 0, 0) }; diff --git a/apps/comments/tests/js/commentstabviewSpec.js b/apps/comments/tests/js/commentstabviewSpec.js index 7dae05bfb461..aaa5915bf19a 100644 --- a/apps/comments/tests/js/commentstabviewSpec.js +++ b/apps/comments/tests/js/commentstabviewSpec.js @@ -44,7 +44,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { fetchStub = sinon.stub(OCA.Comments.CommentCollection.prototype, 'fetchNext'); view = new OCA.Comments.CommentsTabView(); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 5, + id: '5', name: 'One.txt', mimetype: 'text/plain', permissions: 31, @@ -60,7 +60,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { actorId: 'user1', actorDisplayName: 'User One', objectType: 'files', - objectId: 5, + objectId: '5', message: 'First', creationDateTime: new Date(Date.UTC(2016, 1, 3, 10, 5, 0)).toUTCString() }); @@ -70,7 +70,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { actorId: 'user2', actorDisplayName: 'User Two', objectType: 'files', - objectId: 5, + objectId: '5', message: 'Second\nNewline', creationDateTime: new Date(Date.UTC(2016, 1, 3, 10, 0, 0)).toUTCString() }); @@ -162,7 +162,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { actorId: 'user3', actorDisplayName: 'User Three', objectType: 'files', - objectId: 5, + objectId: '5', message: 'Third', creationDateTime: new Date(Date.UTC(2016, 1, 3, 5, 0, 0)).toUTCString() }); diff --git a/apps/comments/tests/js/filespluginSpec.js b/apps/comments/tests/js/filespluginSpec.js index 78becc5af09f..5faef6122ee2 100644 --- a/apps/comments/tests/js/filespluginSpec.js +++ b/apps/comments/tests/js/filespluginSpec.js @@ -29,7 +29,7 @@ describe('OCA.Comments.FilesPlugin tests', function() { OCA.Comments.FilesPlugin.attach(fileList); testFiles = [{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 015635c2e1d8..d0e68b5e6e1e 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -619,7 +619,7 @@ this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory(); - context.fileList.changeDirectory(OC.joinPaths(dir, filename), true, false, parseInt(context.$file.attr('data-id'), 10)); + context.fileList.changeDirectory(OC.joinPaths(dir, filename), true, false, context.$file.attr('data-id')); }); this.registerAction({ diff --git a/apps/files/js/fileinfomodel.js b/apps/files/js/fileinfomodel.js index 2205c7e64772..e31997617ea7 100644 --- a/apps/files/js/fileinfomodel.js +++ b/apps/files/js/fileinfomodel.js @@ -39,10 +39,6 @@ _filesClient: null, initialize: function(data, options) { - if (!_.isUndefined(data.id)) { - data.id = parseInt(data.id, 10); - } - if( options ){ if (options.filesClient) { this._filesClient = options.filesClient; diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 6c29c192c087..6f5162f556b9 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -894,7 +894,7 @@ elementToFile: function($el){ $el = $($el); var data = { - id: parseInt($el.attr('data-id'), 10), + id: $el.attr('data-id'), name: $el.attr('data-file'), mimetype: $el.attr('data-mime'), mtime: parseInt($el.attr('data-mtime'), 10), @@ -1859,7 +1859,7 @@ remove: function(name, options){ options = options || {}; var fileEl = this.findFileEl(name); - var fileId = fileEl.data('id'); + var fileId = fileEl.attr('data-id'); var index = fileEl.index(); if (!fileEl.length) { return null; diff --git a/apps/files/tests/js/detailsviewSpec.js b/apps/files/tests/js/detailsviewSpec.js index 734c6f122b24..781fd56e2b9e 100644 --- a/apps/files/tests/js/detailsviewSpec.js +++ b/apps/files/tests/js/detailsviewSpec.js @@ -52,7 +52,7 @@ describe('OCA.Files.DetailsView tests', function() { detailsView.addDetailView(testView2); detailsView.render(); - var fileInfo = {id: 5, name: 'test.txt'}; + var fileInfo = {id: '5', name: 'test.txt'}; viewRenderStub.reset(); detailsView.setFileInfo(fileInfo); @@ -80,8 +80,8 @@ describe('OCA.Files.DetailsView tests', function() { it('updates tab model and rerenders on-demand as soon as it gets selected', function() { var tab1RenderStub = sinon.stub(testView, 'render'); var tab2RenderStub = sinon.stub(testView2, 'render'); - var fileInfo1 = new OCA.Files.FileInfoModel({id: 5, name: 'test.txt'}); - var fileInfo2 = new OCA.Files.FileInfoModel({id: 8, name: 'test2.txt'}); + var fileInfo1 = new OCA.Files.FileInfoModel({id: '5', name: 'test.txt'}); + var fileInfo2 = new OCA.Files.FileInfoModel({id: '8', name: 'test2.txt'}); detailsView.setFileInfo(fileInfo1); @@ -166,7 +166,7 @@ describe('OCA.Files.DetailsView tests', function() { detailsView.addTabView(testView2); detailsView.addTabView(testView3); - var fileInfo = {id: 5, name: 'test.txt'}; + var fileInfo = {id: '5', name: 'test.txt'}; detailsView.setFileInfo(fileInfo); expect(testView.canDisplay.calledOnce).toEqual(true); @@ -184,7 +184,7 @@ describe('OCA.Files.DetailsView tests', function() { detailsView.addTabView(testView); detailsView.addTabView(testView2); - var fileInfo = {id: 5, name: 'test.txt'}; + var fileInfo = {id: '5', name: 'test.txt'}; detailsView.setFileInfo(fileInfo); expect(testView.canDisplay.calledOnce).toEqual(true); @@ -203,13 +203,13 @@ describe('OCA.Files.DetailsView tests', function() { detailsView.addTabView(testView); detailsView.addTabView(testView2); - var fileInfo = {id: 5, name: 'test.txt', mimetype: 'text/plain'}; + var fileInfo = {id: '5', name: 'test.txt', mimetype: 'text/plain'}; detailsView.setFileInfo(fileInfo); expect(detailsView.$el.find('.tabHeader[data-tabid=test1]').hasClass('selected')).toEqual(true); expect(detailsView.$el.find('.tabHeader[data-tabid=test2]').hasClass('selected')).toEqual(false); - detailsView.setFileInfo({id: 10, name: 'folder', mimetype: 'httpd/unix-directory'}); + detailsView.setFileInfo({id: '10', name: 'folder', mimetype: 'httpd/unix-directory'}); expect(detailsView.$el.find('.tabHeader[data-tabid=test1]').hasClass('selected')).toEqual(false); expect(detailsView.$el.find('.tabHeader[data-tabid=test2]').hasClass('selected')).toEqual(true); diff --git a/apps/files/tests/js/favoritesfilelistspec.js b/apps/files/tests/js/favoritesfilelistspec.js index db890927ed40..fff843c69660 100644 --- a/apps/files/tests/js/favoritesfilelistspec.js +++ b/apps/files/tests/js/favoritesfilelistspec.js @@ -67,7 +67,7 @@ describe('OCA.Files.FavoritesFileList tests', function() { expect(fetchStub.calledOnce).toEqual(true); deferred.resolve(207, [{ - id: 7, + id: '7', name: 'test.txt', path: '/somedir', size: 123, diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js index f373c6b9c301..ea9cc1721f23 100644 --- a/apps/files/tests/js/fileactionsSpec.js +++ b/apps/files/tests/js/fileactionsSpec.js @@ -79,7 +79,7 @@ describe('OCA.Files.FileActions tests', function() { beforeEach(function() { var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', @@ -273,7 +273,7 @@ describe('OCA.Files.FileActions tests', function() { beforeEach(function() { clock = sinon.useFakeTimers(); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', @@ -318,7 +318,7 @@ describe('OCA.Files.FileActions tests', function() { }); it('also triggers action handler when calling triggerAction()', function() { var model = new OCA.Files.FileInfoModel({ - id: 1, + id: '1', name: 'Test.txt', path: '/subdir', mime: 'text/plain', @@ -359,7 +359,7 @@ describe('OCA.Files.FileActions tests', function() { var $tr; beforeEach(function() { var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', @@ -408,7 +408,7 @@ describe('OCA.Files.FileActions tests', function() { var $tr; beforeEach(function() { var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', path: '/anotherpath/there', @@ -621,7 +621,7 @@ describe('OCA.Files.FileActions tests', function() { var handleDownloadStub = sinon.stub(OCA.Files.Files, 'handleDownload'); var busyStub = sinon.stub(fileList, 'showFileBusyState'); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', diff --git a/apps/files/tests/js/fileactionsmenuSpec.js b/apps/files/tests/js/fileactionsmenuSpec.js index 5d9b70910f78..a952f8d4e92f 100644 --- a/apps/files/tests/js/fileactionsmenuSpec.js +++ b/apps/files/tests/js/fileactionsmenuSpec.js @@ -70,7 +70,7 @@ describe('OCA.Files.FileActionsMenu tests', function() { fileActions.setDefault('all', 'Testdefault'); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', @@ -228,7 +228,7 @@ describe('OCA.Files.FileActionsMenu tests', function() { it('redirects to download URL when clicking download', function() { var redirectStub = sinon.stub(OC, 'redirect'); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', mimetype: 'text/plain', @@ -260,7 +260,7 @@ describe('OCA.Files.FileActionsMenu tests', function() { it('takes the file\'s path into account when clicking download', function() { var redirectStub = sinon.stub(OC, 'redirect'); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', path: '/anotherpath/there', @@ -292,7 +292,7 @@ describe('OCA.Files.FileActionsMenu tests', function() { it('deletes file when clicking delete', function() { var deleteStub = sinon.stub(fileList, 'do_delete'); var fileData = { - id: 18, + id: '18', type: 'file', name: 'testName.txt', path: '/somepath/dir', diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index ea428686cc59..0a56a428674f 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -43,7 +43,7 @@ describe('OCA.Files.FileList tests', function() { } name += i + '.txt'; files.push(new FileInfo({ - id: i, + id: '' + i, type: 'file', name: name, mimetype: 'text/plain', @@ -111,7 +111,7 @@ describe('OCA.Files.FileList tests', function() { testRoot = new FileInfo({ // root entry - id: 99, + id: '99', type: 'dir', name: '/subdir', mimetype: 'httpd/unix-directory', @@ -120,7 +120,7 @@ describe('OCA.Files.FileList tests', function() { permissions: OC.PERMISSION_ALL }); testFiles = [new FileInfo({ - id: 1, + id: '1', type: 'file', name: 'One.txt', mimetype: 'text/plain', @@ -129,7 +129,7 @@ describe('OCA.Files.FileList tests', function() { etag: 'abc', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 2, + id: '2', type: 'file', name: 'Two.jpg', mimetype: 'image/jpeg', @@ -138,7 +138,7 @@ describe('OCA.Files.FileList tests', function() { etag: 'def', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 3, + id: '3', type: 'file', name: 'Three.pdf', mimetype: 'application/pdf', @@ -147,7 +147,7 @@ describe('OCA.Files.FileList tests', function() { etag: '123', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 4, + id: '4', type: 'dir', name: 'somedir', mimetype: 'httpd/unix-directory', @@ -197,7 +197,7 @@ describe('OCA.Files.FileList tests', function() { }); it('generates file element with correct attributes when calling add() with file data', function() { var fileData = new FileInfo({ - id: 18, + id: '18', name: 'testName.txt', mimetype: 'text/plain', size: 1234, @@ -226,7 +226,7 @@ describe('OCA.Files.FileList tests', function() { }); it('generates dir element with correct attributes when calling add() with dir data', function() { var fileData = new FileInfo({ - id: 19, + id: '19', name: 'testFolder', mimetype: 'httpd/unix-directory', size: 1234, @@ -1164,7 +1164,7 @@ describe('OCA.Files.FileList tests', function() { }); it('inserts into the DOM if insertion point is in the visible page ', function() { fileList.add({ - id: 2000, + id: '2000', type: 'file', name: 'File with index 15b.txt' }); @@ -1173,7 +1173,7 @@ describe('OCA.Files.FileList tests', function() { }); it('does not inserts into the DOM if insertion point is not the visible page ', function() { fileList.add({ - id: 2000, + id: '2000', type: 'file', name: 'File with index 28b.txt' }); @@ -1185,7 +1185,7 @@ describe('OCA.Files.FileList tests', function() { }); it('appends into the DOM when inserting a file after the last visible element', function() { fileList.add({ - id: 2000, + id: '2000', type: 'file', name: 'File with index 19b.txt' }); @@ -1202,7 +1202,7 @@ describe('OCA.Files.FileList tests', function() { expect($('#fileList tr').length).toEqual(65); fileList._nextPage(true); fileList.add({ - id: 2000, + id: '2000', type: 'file', name: 'File with index 88.txt' }); @@ -1507,7 +1507,7 @@ describe('OCA.Files.FileList tests', function() { deferredList.resolve(200, [testRoot].concat(testFiles)); expect(handler.calledOnce).toEqual(true); expect(handler.getCall(0).args[0].dir).toEqual('/somedir'); - expect(handler.getCall(0).args[0].fileId).toEqual(99); + expect(handler.getCall(0).args[0].fileId).toEqual('99'); }); it('changes the directory when receiving "urlChanged" event', function() { $('#app-content-files').trigger(new $.Event('urlChanged', {view: 'files', dir: '/somedir'})); @@ -1957,7 +1957,7 @@ describe('OCA.Files.FileList tests', function() { var files = fileList.getSelectedFiles(); expect(files.length).toEqual(3); expect(files[0]).toEqual({ - id: 1, + id: '1', name: 'One.txt', mimetype: 'text/plain', mtime: 123456789, @@ -1967,7 +1967,7 @@ describe('OCA.Files.FileList tests', function() { permissions: OC.PERMISSION_ALL }); expect(files[1]).toEqual({ - id: 3, + id: '3', type: 'file', name: 'Three.pdf', mimetype: 'application/pdf', @@ -1977,7 +1977,7 @@ describe('OCA.Files.FileList tests', function() { permissions: OC.PERMISSION_ALL }); expect(files[2]).toEqual({ - id: 4, + id: '4', type: 'dir', name: 'somedir', mimetype: 'httpd/unix-directory', @@ -1986,11 +1986,11 @@ describe('OCA.Files.FileList tests', function() { etag: '456', permissions: OC.PERMISSION_ALL }); - expect(files[0].id).toEqual(1); + expect(files[0].id).toEqual('1'); expect(files[0].name).toEqual('One.txt'); - expect(files[1].id).toEqual(3); + expect(files[1].id).toEqual('3'); expect(files[1].name).toEqual('Three.pdf'); - expect(files[2].id).toEqual(4); + expect(files[2].id).toEqual('4'); expect(files[2].name).toEqual('somedir'); }); it('Removing a file removes it from the selection', function() { @@ -1998,7 +1998,7 @@ describe('OCA.Files.FileList tests', function() { var files = fileList.getSelectedFiles(); expect(files.length).toEqual(2); expect(files[0]).toEqual({ - id: 1, + id: '1', name: 'One.txt', mimetype: 'text/plain', mtime: 123456789, @@ -2008,7 +2008,7 @@ describe('OCA.Files.FileList tests', function() { permissions: OC.PERMISSION_ALL }); expect(files[1]).toEqual({ - id: 4, + id: '4', type: 'dir', name: 'somedir', mimetype: 'httpd/unix-directory', @@ -2189,7 +2189,7 @@ describe('OCA.Files.FileList tests', function() { $tr.find('td.filename>a.name').click(); expect($tr.hasClass('highlighted')).toEqual(true); - expect(fileList._detailsView.getFileInfo().id).toEqual(1); + expect(fileList._detailsView.getFileInfo().id).toEqual('1'); }); it('keeps the last highlighted file when clicking outside', function() { var $tr = fileList.findFileEl('One.txt'); @@ -2198,7 +2198,7 @@ describe('OCA.Files.FileList tests', function() { fileList.$el.find('tfoot').click(); expect($tr.hasClass('highlighted')).toEqual(true); - expect(fileList._detailsView.getFileInfo().id).toEqual(1); + expect(fileList._detailsView.getFileInfo().id).toEqual('1'); }); it('removes last highlighted file when selecting via checkbox', function() { var $tr = fileList.findFileEl('One.txt'); @@ -2235,7 +2235,7 @@ describe('OCA.Files.FileList tests', function() { $tr.find('td.filename>a.name').click(); expect($tr.hasClass('highlighted')).toEqual(true); - expect(fileList._detailsView.getFileInfo().id).toEqual(1); + expect(fileList._detailsView.getFileInfo().id).toEqual('1'); expect($('#app-sidebar').hasClass('disappear')).toEqual(false); fileList.remove('One.txt'); @@ -2410,7 +2410,7 @@ describe('OCA.Files.FileList tests', function() { fileList.setFiles(testFiles); fileList.$el.find('.column-size .columntitle').click(); var newFileData = new FileInfo({ - id: 999, + id: '999', name: 'new file.txt', mimetype: 'text/plain', size: 40001, @@ -2433,7 +2433,7 @@ describe('OCA.Files.FileList tests', function() { // reverse sort fileList.$el.find('.column-size .columntitle').click(); var newFileData = new FileInfo({ - id: 999, + id: '999', name: 'new file.txt', mimetype: 'text/plain', size: 40001, @@ -2960,7 +2960,7 @@ describe('OCA.Files.FileList tests', function() { it('converts data attributes to file info structure', function() { var fileInfo = fileList.elementToFile($tr); - expect(fileInfo.id).toEqual(1); + expect(fileInfo.id).toEqual('1'); expect(fileInfo.name).toEqual('One.txt'); expect(fileInfo.mtime).toEqual(123456789); expect(fileInfo.etag).toEqual('abc'); diff --git a/apps/files/tests/js/mainfileinfodetailviewSpec.js b/apps/files/tests/js/mainfileinfodetailviewSpec.js index 953fcbd41d1b..d2a17bf70688 100644 --- a/apps/files/tests/js/mainfileinfodetailviewSpec.js +++ b/apps/files/tests/js/mainfileinfodetailviewSpec.js @@ -33,7 +33,7 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { fileActions: fileActions }); testFileInfo = new OCA.Files.FileInfoModel({ - id: 5, + id: '5', name: 'One.txt', mimetype: 'text/plain', permissions: 31, @@ -198,7 +198,7 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { it('unbinds change listener from model', function() { view.setFileInfo(testFileInfo); view.setFileInfo(new OCA.Files.FileInfoModel({ - id: 999, + id: '999', name: 'test.txt', path: '/' })); diff --git a/apps/files/tests/js/tagspluginspec.js b/apps/files/tests/js/tagspluginspec.js index a4efc08aa535..12a039989dc3 100644 --- a/apps/files/tests/js/tagspluginspec.js +++ b/apps/files/tests/js/tagspluginspec.js @@ -29,7 +29,7 @@ describe('OCA.Files.TagsPlugin tests', function() { OCA.Files.TagsPlugin.attach(fileList); testFiles = [{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', diff --git a/apps/files_sharing/lib/API/Remote.php b/apps/files_sharing/lib/API/Remote.php index 62758ded5c61..ed9f11c51b3b 100644 --- a/apps/files_sharing/lib/API/Remote.php +++ b/apps/files_sharing/lib/API/Remote.php @@ -134,7 +134,7 @@ private static function extendShareInfo($share) { $share['mtime'] = $info->getMtime(); $share['permissions'] = $info->getPermissions(); $share['type'] = $info->getType(); - $share['file_id'] = $info->getId(); + $share['file_id'] = strval($info->getId()); return $share; } diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index abdff01bbb2e..425442dffd06 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -171,9 +171,9 @@ protected function formatShare(\OCP\Share\IShare $share) { $result['mimetype'] = $node->getMimeType(); $result['storage_id'] = $node->getStorage()->getId(); $result['storage'] = $node->getStorage()->getCache()->getNumericStorageId(); - $result['item_source'] = $node->getId(); - $result['file_source'] = $node->getId(); - $result['file_parent'] = $node->getParent()->getId(); + $result['item_source'] = strval($node->getId()); + $result['file_source'] = strval($node->getId()); + $result['file_parent'] = strval($node->getParent()->getId()); $result['file_target'] = $share->getTarget(); if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 1573bb55b4bb..90b69c6d89ad 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -44,7 +44,7 @@ describe('OCA.Sharing.Util tests', function() { OCA.Sharing.Util.attach(fileList); testFiles = [{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -72,7 +72,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {}; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One', path: '/subdir', @@ -91,7 +91,7 @@ describe('OCA.Sharing.Util tests', function() { it('shows simple share text with share icon', function() { var $action, $tr; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One', path: '/subdir', @@ -112,7 +112,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {1: {link: true, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One', path: '/subdir', @@ -132,7 +132,7 @@ describe('OCA.Sharing.Util tests', function() { it('shows owner name when owner is available', function() { var $action, $tr; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One.txt', path: '/subdir', @@ -153,7 +153,7 @@ describe('OCA.Sharing.Util tests', function() { it('shows recipients when recipients are available', function() { var $action, $tr; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One.txt', path: '/subdir', @@ -174,7 +174,7 @@ describe('OCA.Sharing.Util tests', function() { it('shows share action when shared with user who has no share permission', function() { var $action, $tr; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One', path: '/subdir', @@ -190,7 +190,7 @@ describe('OCA.Sharing.Util tests', function() { it('do not show share action when share exists but neither permission nor owner is available', function() { var $action, $tr; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One', path: '/subdir', @@ -224,7 +224,7 @@ describe('OCA.Sharing.Util tests', function() { var showDetailsViewStub = sinon.stub(fileList, 'showDetailsView'); fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -247,7 +247,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -281,7 +281,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -314,7 +314,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -340,7 +340,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -370,7 +370,7 @@ describe('OCA.Sharing.Util tests', function() { var $action, $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', @@ -481,7 +481,7 @@ describe('OCA.Sharing.Util tests', function() { var attributes = { itemType: 'file', - itemSource: 123, + itemSource: '123', possiblePermissions: 31, permissions: 31 }; @@ -503,14 +503,14 @@ describe('OCA.Sharing.Util tests', function() { reshare: {}, shares: [{ id: 100, - item_source: 1, + item_source: '1', permissions: 31, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', share_with_displayname: 'User One' }, { id: 102, - item_source: 1, + item_source: '1', permissions: 31, share_type: OC.Share.SHARE_TYPE_REMOTE, share_with: 'foo@bar.com/baz', diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js index 3efbb8fcea3f..37f4813f4957 100644 --- a/apps/files_sharing/tests/js/sharedfilelistSpec.js +++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js @@ -85,9 +85,9 @@ describe('OCA.Sharing.FileList tests', function() { data: [{ id: 7, item_type: 'file', - item_source: 49, + item_source: '49', item_target: '/49', - file_source: 49, + file_source: '49', file_target: '/local path/local name.txt', path: 'files/something shared.txt', permissions: 31, @@ -126,7 +126,7 @@ describe('OCA.Sharing.FileList tests', function() { mtime: 22222, permissions: 31, type: 'file', - file_id: 1337 + file_id: '1337' }] } }; @@ -304,8 +304,8 @@ describe('OCA.Sharing.FileList tests', function() { data: [{ id: 7, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 27, stime: 11111, @@ -406,8 +406,8 @@ describe('OCA.Sharing.FileList tests', function() { ocsResponse.ocs.data[0] = { id: 7, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 1, stime: 11111, @@ -460,8 +460,8 @@ describe('OCA.Sharing.FileList tests', function() { ocsResponse.ocs.data.push({ id: 8, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 1, stime: 11111, @@ -477,8 +477,8 @@ describe('OCA.Sharing.FileList tests', function() { ocsResponse.ocs.data.push({ id: 9, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 27, stime: 22222, @@ -551,8 +551,8 @@ describe('OCA.Sharing.FileList tests', function() { data: [{ id: 7, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 1, stime: 11111, @@ -567,8 +567,8 @@ describe('OCA.Sharing.FileList tests', function() { },{ id: 8, item_type: 'file', - item_source: 50, - file_source: 50, + item_source: '50', + file_source: '50', path: '/local path2/local name2.txt', permissions: 1, stime: 11112, @@ -590,8 +590,8 @@ describe('OCA.Sharing.FileList tests', function() { // non-link share id: 8, item_type: 'file', - item_source: 49, - file_source: 49, + item_source: '49', + file_source: '49', path: '/local path/local name.txt', permissions: 27, stime: 11111, @@ -716,7 +716,7 @@ describe('OCA.Sharing.FileList tests', function() { var $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One.txt', path: '/subdir', @@ -737,7 +737,7 @@ describe('OCA.Sharing.FileList tests', function() { var $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'dir', name: 'One.txt', path: '/subdir', @@ -758,7 +758,7 @@ describe('OCA.Sharing.FileList tests', function() { var $tr; OC.Share.statuses = {1: {link: false, path: '/subdir'}}; fileList.setFiles([{ - id: 1, + id: '1', type: 'file', name: 'One.txt', path: '/subdir', diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js index 59b61c071d13..0a0d0ea15801 100644 --- a/apps/files_trashbin/tests/js/filelistSpec.js +++ b/apps/files_trashbin/tests/js/filelistSpec.js @@ -57,28 +57,28 @@ describe('OCA.Trashbin.FileList tests', function() { ); testFiles = [{ - id: 1, + id: '1', type: 'file', name: 'One.txt', mtime: 11111000, mimetype: 'text/plain', etag: 'abc' }, { - id: 2, + id: '2', type: 'file', name: 'Two.jpg', mtime: 22222000, mimetype: 'image/jpeg', etag: 'def', }, { - id: 3, + id: '3', type: 'file', name: 'Three.pdf', mtime: 33333000, mimetype: 'application/pdf', etag: '123', }, { - id: 4, + id: '4', type: 'dir', mtime: 99999000, name: 'somedir', @@ -244,7 +244,7 @@ describe('OCA.Trashbin.FileList tests', function() { it('converts data attributes to file info structure', function() { var fileInfo = fileList.elementToFile($tr); - expect(fileInfo.id).toEqual(1); + expect(fileInfo.id).toEqual('1'); expect(fileInfo.name).toEqual('One.txt.d11111'); expect(fileInfo.displayName).toEqual('One.txt'); expect(fileInfo.mtime).toEqual(11111000); diff --git a/apps/files_versions/tests/js/versionmodelSpec.js b/apps/files_versions/tests/js/versionmodelSpec.js index 20fbe1a719e5..35887726e1eb 100644 --- a/apps/files_versions/tests/js/versionmodelSpec.js +++ b/apps/files_versions/tests/js/versionmodelSpec.js @@ -20,7 +20,7 @@ describe('OCA.Versions.VersionModel', function() { beforeEach(function() { model = new VersionModel({ id: 123456789, - fileId: 10000000, + fileId: '10000000', timestamp: 10000000, fullPath: '/subdir/some file.txt', name: 'some file.txt', diff --git a/apps/files_versions/tests/js/versionstabviewSpec.js b/apps/files_versions/tests/js/versionstabviewSpec.js index 2e4bbb693c73..46e7f3b864fa 100644 --- a/apps/files_versions/tests/js/versionstabviewSpec.js +++ b/apps/files_versions/tests/js/versionstabviewSpec.js @@ -38,7 +38,7 @@ describe('OCA.Versions.VersionsTabView', function() { fetchStub = sinon.stub(VersionCollection.prototype, 'fetch'); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'test.txt', permissions: OC.PERMISSION_READ | OC.PERMISSION_UPDATE }); diff --git a/apps/systemtags/tests/js/systemtagsfilelistSpec.js b/apps/systemtags/tests/js/systemtagsfilelistSpec.js index ba41d347ca45..8386e70b689b 100644 --- a/apps/systemtags/tests/js/systemtagsfilelistSpec.js +++ b/apps/systemtags/tests/js/systemtagsfilelistSpec.js @@ -180,7 +180,7 @@ describe('OCA.SystemTags.FileList tests', function() { expect(getFilteredFilesSpec.lastCall.args[0].systemTagIds).toEqual(['123', '456']); var testFiles = [new FileInfo({ - id: 1, + id: '1', type: 'file', name: 'One.txt', mimetype: 'text/plain', @@ -189,7 +189,7 @@ describe('OCA.SystemTags.FileList tests', function() { etag: 'abc', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 2, + id: '2', type: 'file', name: 'Two.jpg', mimetype: 'image/jpeg', @@ -198,7 +198,7 @@ describe('OCA.SystemTags.FileList tests', function() { etag: 'def', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 3, + id: '3', type: 'file', name: 'Three.pdf', mimetype: 'application/pdf', @@ -207,7 +207,7 @@ describe('OCA.SystemTags.FileList tests', function() { etag: '123', permissions: OC.PERMISSION_ALL }), new FileInfo({ - id: 4, + id: '4', type: 'dir', name: 'somedir', mimetype: 'httpd/unix-directory', diff --git a/core/js/files/fileinfo.js b/core/js/files/fileinfo.js index 3bf68d88b15c..740ad0899b81 100644 --- a/core/js/files/fileinfo.js +++ b/core/js/files/fileinfo.js @@ -27,7 +27,7 @@ }); if (!_.isUndefined(this.id)) { - this.id = parseInt(data.id, 10); + this.id = data.id; } // TODO: normalize path diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index bf35829c82e8..40d5092893c1 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -61,7 +61,7 @@ * of integers, so we need to convert them accordingly... */ var SHARE_RESPONSE_INT_PROPS = [ - 'id', 'file_parent', 'mail_send', 'file_source', 'item_source', 'permissions', + 'id', 'mail_send', 'permissions', 'storage', 'share_type', 'parent', 'stime' ]; diff --git a/core/js/tests/specs/files/clientSpec.js b/core/js/tests/specs/files/clientSpec.js index ce037cbfda5a..81b1eb784b0f 100644 --- a/core/js/tests/specs/files/clientSpec.js +++ b/core/js/tests/specs/files/clientSpec.js @@ -269,7 +269,7 @@ describe('OC.Files.Client tests', function() { // file entry var info = response[0]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(51); + expect(info.id).toEqual('51'); expect(info.path).toEqual('/path/to sp@ce/文件夹'); expect(info.name).toEqual('One.txt'); expect(info.permissions).toEqual(27); @@ -281,7 +281,7 @@ describe('OC.Files.Client tests', function() { // sub entry info = response[1]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(15); + expect(info.id).toEqual('15'); expect(info.path).toEqual('/path/to sp@ce/文件夹'); expect(info.name).toEqual('sub'); expect(info.permissions).toEqual(31); @@ -310,7 +310,7 @@ describe('OC.Files.Client tests', function() { // root entry var info = response[0]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(11); + expect(info.id).toEqual('11'); expect(info.path).toEqual('/path/to sp@ce'); expect(info.name).toEqual('文件夹'); expect(info.permissions).toEqual(31); @@ -320,8 +320,8 @@ describe('OC.Files.Client tests', function() { expect(info.etag).toEqual('56cfcabd79abb'); // the two other entries follow - expect(response[1].id).toEqual(51); - expect(response[2].id).toEqual(15); + expect(response[1].id).toEqual('51'); + expect(response[2].id).toEqual('15'); }); }); it('rejects promise when an error occurred', function() { @@ -460,17 +460,17 @@ describe('OC.Files.Client tests', function() { // file entry var info = response[0]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(11); + expect(info.id).toEqual('11'); // file entry var info = response[1]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(51); + expect(info.id).toEqual('51'); // sub entry info = response[2]; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(15); + expect(info.id).toEqual('15'); }); }); it('throws exception if arguments are missing', function() { @@ -542,7 +542,7 @@ describe('OC.Files.Client tests', function() { var info = response; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(11); + expect(info.id).toEqual('11'); expect(info.path).toEqual('/path/to sp@ce'); expect(info.name).toEqual('文件夹'); expect(info.permissions).toEqual(31); @@ -590,7 +590,7 @@ describe('OC.Files.Client tests', function() { var info = response; expect(info instanceof OC.Files.FileInfo).toEqual(true); - expect(info.id).toEqual(11); + expect(info.id).toEqual('11'); expect(info.path).toEqual('/'); expect(info.name).toEqual('in root'); expect(info.permissions).toEqual(31); diff --git a/core/js/tests/specs/sharedialogexpirationviewSpec.js b/core/js/tests/specs/sharedialogexpirationviewSpec.js index fb04abee4533..8c48a32c0211 100644 --- a/core/js/tests/specs/sharedialogexpirationviewSpec.js +++ b/core/js/tests/specs/sharedialogexpirationviewSpec.js @@ -30,7 +30,7 @@ describe('OC.Share.ShareDialogExpirationView', function() { beforeEach(function() { configModel = new OC.Share.ShareConfigModel(); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_folder', path: '/subdir', size: 100, diff --git a/core/js/tests/specs/sharedialoglinklistviewSpec.js b/core/js/tests/specs/sharedialoglinklistviewSpec.js index fead35eef192..c76d735cea55 100644 --- a/core/js/tests/specs/sharedialoglinklistviewSpec.js +++ b/core/js/tests/specs/sharedialoglinklistviewSpec.js @@ -32,7 +32,7 @@ describe('OC.Share.ShareDialogLinkListView', function() { beforeEach(function() { configModel = new OC.Share.ShareConfigModel(); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_file_name.txt', path: '/subdir', size: 100, diff --git a/core/js/tests/specs/sharedialoglinkshareviewSpec.js b/core/js/tests/specs/sharedialoglinkshareviewSpec.js index 2ecdbca648ff..bef6e201f939 100644 --- a/core/js/tests/specs/sharedialoglinkshareviewSpec.js +++ b/core/js/tests/specs/sharedialoglinkshareviewSpec.js @@ -33,7 +33,7 @@ describe('OC.Share.ShareDialogLinkShareView', function() { beforeEach(function() { configModel = new OC.Share.ShareConfigModel(); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_folder', path: '/subdir', size: 100, diff --git a/core/js/tests/specs/sharedialogmailviewSpec.js b/core/js/tests/specs/sharedialogmailviewSpec.js index 355a54cd20b5..417b77a25d1d 100644 --- a/core/js/tests/specs/sharedialogmailviewSpec.js +++ b/core/js/tests/specs/sharedialogmailviewSpec.js @@ -30,7 +30,7 @@ describe('OC.Share.ShareDialogMailView', function() { beforeEach(function() { var configModel = new OC.Share.ShareConfigModel(); var fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_folder', path: '/subdir', size: 100, diff --git a/core/js/tests/specs/sharedialogshareelistview.js b/core/js/tests/specs/sharedialogshareelistview.js index 52a83d3a49ac..d4cf191830bb 100644 --- a/core/js/tests/specs/sharedialogshareelistview.js +++ b/core/js/tests/specs/sharedialogshareelistview.js @@ -36,7 +36,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { $('#testArea').append(''); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_file_name.txt', path: '/subdir', size: 100, @@ -93,7 +93,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { it('Renders shares', function() { shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -101,7 +101,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { share_with_additional_info: 'user1@example.com' }, { id: 101, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_GROUP, share_with: 'group1', @@ -128,7 +128,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { it('Checks cruds boxes when edit box checked', function () { shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -143,7 +143,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { it('Checks edit box when create/update/delete are checked', function () { shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -158,7 +158,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { it('shows cruds checkboxes when toggled', function () { shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -173,7 +173,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { var notifStub = sinon.stub(OC.Notification, 'show'); shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -200,7 +200,7 @@ describe('OC.Share.ShareDialogShareeListView', function () { var notifStub = sinon.stub(OC.dialogs, 'alert'); shareModel.set('shares', [{ id: 100, - item_source: 123, + item_source: '123', permissions: 1, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 15aa27f3b4ba..3a4368bcf528 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -48,7 +48,7 @@ describe('OC.Share.ShareDialogView', function() { fetchStub = sinon.stub(OC.Share.ShareItemModel.prototype, 'fetch'); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_file_name.txt', path: '/subdir', size: 100, @@ -130,21 +130,21 @@ describe('OC.Share.ShareDialogView', function() { }, shares: [{ id: 100, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', share_with_displayname: 'User One' },{ id: 101, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_GROUP, share_with: 'group', share_with_displayname: 'group' },{ id: 102, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_REMOTE, share_with: 'foo@bar.com/baz', @@ -448,21 +448,21 @@ describe('OC.Share.ShareDialogView', function() { reshare: {}, shares: [{ id: 100, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', share_with_displayname: 'User One' },{ id: 101, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_GROUP, share_with: 'group', share_with_displayname: 'group' },{ id: 102, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_REMOTE, share_with: 'foo@bar.com/baz', diff --git a/core/js/tests/specs/shareitemmodelSpec.js b/core/js/tests/specs/shareitemmodelSpec.js index c71fec21700a..6774214d613f 100644 --- a/core/js/tests/specs/shareitemmodelSpec.js +++ b/core/js/tests/specs/shareitemmodelSpec.js @@ -38,7 +38,7 @@ describe('OC.Share.ShareItemModel', function() { .returns(fetchReshareDeferred.promise()); fileInfoModel = new OCA.Files.FileInfoModel({ - id: 123, + id: '123', name: 'shared_file_name.txt', path: '/subdir', size: 100, @@ -131,21 +131,21 @@ describe('OC.Share.ShareItemModel', function() { fetchSharesDeferred.resolve(makeOcsResponse([ { id: 100, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', share_with_displayname: 'User One' }, { id: 101, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_GROUP, share_with: 'group', share_with_displayname: 'group' }, { id: 102, - item_source: 123, + item_source: '123', permissions: 31, share_type: OC.Share.SHARE_TYPE_REMOTE, share_with: 'foo@bar.com/baz', @@ -154,7 +154,7 @@ describe('OC.Share.ShareItemModel', function() { }, { displayname_owner: 'root', expiration: null, - file_source: 123, + file_source: '123', file_target: '/folder', id: 20, item_source: '123', @@ -173,7 +173,7 @@ describe('OC.Share.ShareItemModel', function() { }, { displayname_owner: 'root', expiration: '2017-10-12 00:00:00', - file_source: 123, + file_source: '123', file_target: '/folder', id: 21, item_source: '123', @@ -274,7 +274,7 @@ describe('OC.Share.ShareItemModel', function() { fetchSharesDeferred.resolve(makeOcsResponse([{ displayname_owner: 'root', expiration: null, - file_source: 456, + file_source: '456', file_target: '/folder', id: 20, item_source: '456', @@ -308,7 +308,7 @@ describe('OC.Share.ShareItemModel', function() { fetchSharesDeferred.resolve(makeOcsResponse([{ displayname_owner: 'root', expiration: '2015-10-12 00:00:00', - file_source: 123, + file_source: '123', file_target: '/folder', id: 20, item_source: '123', @@ -326,7 +326,7 @@ describe('OC.Share.ShareItemModel', function() { }, { displayname_owner: 'root', expiration: '2015-10-15 00:00:00', - file_source: 456, + file_source: '456', file_target: '/file_in_folder.txt', id: 21, item_source: '456', @@ -401,12 +401,13 @@ describe('OC.Share.ShareItemModel', function() { displayname_owner: 'root', expiration: '2015-10-12 00:00:00', file_source: '123', + file_parent: '444', file_target: '/folder', id: '20', item_source: '123', item_type: 'file', mail_send: '0', - parent: '999', + parent: 999, path: '/folder', permissions: '' + OC.PERMISSION_READ, share_type: '' + OC.Share.SHARE_TYPE_USER, @@ -425,9 +426,10 @@ describe('OC.Share.ShareItemModel', function() { var share = shares[0]; expect(share.id).toEqual(20); - expect(share.file_source).toEqual(123); + expect(share.file_source).toEqual('123'); + expect(share.file_parent).toEqual('444'); expect(share.file_target).toEqual('/folder'); - expect(share.item_source).toEqual(123); + expect(share.item_source).toEqual('123'); expect(share.item_type).toEqual('file'); expect(share.displayname_owner).toEqual('root'); expect(share.mail_send).toEqual(0); @@ -750,7 +752,7 @@ describe('OC.Share.ShareItemModel', function() { var shares = _.map(shareTypes, function(shareType) { return { id: id++, - item_source: 123, + item_source: '123', permissions: 31, share_type: shareType, uid_owner: 'root'