Merge pull request #21573 from owncloud/fix_21535_21534
Do not increase filecount in web on file update
This commit is contained in:
commit
2ee39cf4cf
|
@ -1758,7 +1758,9 @@
|
|||
updateRow: function($tr, fileInfo, options) {
|
||||
this.files.splice($tr.index(), 1);
|
||||
$tr.remove();
|
||||
$tr = this.add(fileInfo, _.extend({updateSummary: false, silent: true}, options));
|
||||
options = _.extend({silent: true}, options);
|
||||
options = _.extend(options, {updateSummary: false});
|
||||
$tr = this.add(fileInfo, options);
|
||||
this.$fileList.trigger($.Event('fileActionsReady', {fileList: this, $files: $tr}));
|
||||
return $tr;
|
||||
},
|
||||
|
|
|
@ -812,6 +812,22 @@ describe('OCA.Files.FileList tests', function() {
|
|||
.toEqual(OC.imagePath('core', 'filetypes/text.svg'));
|
||||
});
|
||||
});
|
||||
describe('Update file', function() {
|
||||
it('does not change summary', function() {
|
||||
var $summary = $('#filestable .summary');
|
||||
var fileData = new FileInfo({
|
||||
type: 'file',
|
||||
name: 'test file',
|
||||
});
|
||||
var $tr = fileList.add(fileData);
|
||||
|
||||
expect($summary.find('.info').text()).toEqual('0 folders and 1 file');
|
||||
|
||||
var model = fileList.getModelForFile('test file');
|
||||
model.set({size: '100'});
|
||||
expect($summary.find('.info').text()).toEqual('0 folders and 1 file');
|
||||
});
|
||||
})
|
||||
describe('List rendering', function() {
|
||||
it('renders a list of files using add()', function() {
|
||||
expect(fileList.files.length).toEqual(0);
|
||||
|
|
Loading…
Reference in New Issue