summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-09 22:47:26 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-09 22:47:26 +0100
commit665d7b25b04b8f2be28957bd0d87e6ef554db973 (patch)
treed28490311e2bc25e02c55be75321ceb3c6ea6058 /apps/files
parent86735c6b5a6d46f1e66ae170e498446af786b98e (diff)
downloadnextcloud-server-665d7b25b04b8f2be28957bd0d87e6ef554db973.tar.gz
nextcloud-server-665d7b25b04b8f2be28957bd0d87e6ef554db973.zip
Add unit test for file update
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/tests/js/filelistSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 9dfcdfead7f..e6046f2197e 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -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);