summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-10 20:07:02 +0200
committerVincent Petry <pvince81@owncloud.com>2014-04-28 14:55:01 +0200
commita15b68c10fa7401dc4b30a173c80084bf114dde9 (patch)
treeab679a3670992adfdbae4a732de9b2d013c1cdbf /apps/files/tests
parentc29e8b0bae8998ba55efd5f34f4c8d1e7034ffdc (diff)
downloadnextcloud-server-a15b68c10fa7401dc4b30a173c80084bf114dde9.tar.gz
nextcloud-server-a15b68c10fa7401dc4b30a173c80084bf114dde9.zip
Fixed selection summary calculation issue
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index be285a7b636..da209220cca 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1118,6 +1118,32 @@ describe('FileList tests', function() {
expect($('#select_all').prop('checked')).toEqual(false);
expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3);
});
+ it('Updates the selection summary when doing a few manipulations with "Select all"', function() {
+ $('#select_all').click();
+ expect($('#select_all').prop('checked')).toEqual(true);
+
+ var $tr = FileList.findFileEl('One.txt');
+ // unselect one
+ $tr.find('input:checkbox').click();
+
+ expect($('#select_all').prop('checked')).toEqual(false);
+ expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3);
+
+ // select all
+ $('#select_all').click();
+ expect($('#select_all').prop('checked')).toEqual(true);
+ expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(4);
+
+ // unselect one
+ $tr.find('input:checkbox').click();
+ expect($('#select_all').prop('checked')).toEqual(false);
+ expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3);
+
+ // re-select it
+ $tr.find('input:checkbox').click();
+ expect($('#select_all').prop('checked')).toEqual(true);
+ expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(4);
+ });
it('Auto-selects files on next page when "select all" is checked', function() {
FileList.setFiles(generateFiles(0, 41));
$('#select_all').click();