summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-15 14:58:44 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-15 14:58:44 +0100
commitd565290d16ac708a3ae561d564484acc0fac0610 (patch)
tree638c6e817178ebdeae1dd1cd125fb60004653a34 /apps/files/tests
parent46b39c3465e2db9ba26b23d8d0dfca6cc670aaea (diff)
downloadnextcloud-server-d565290d16ac708a3ae561d564484acc0fac0610.tar.gz
nextcloud-server-d565290d16ac708a3ae561d564484acc0fac0610.zip
Close file detail sidebar when selecting/unselecting files
Interacting with the checkboxes, also "Select all" will automatically close the sidebar now.
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js31
1 files changed, 26 insertions, 5 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 0091a9ee6e4..ed56011866e 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -86,7 +86,7 @@ describe('OCA.Files.FileList tests', function() {
'<table id="filestable">' +
'<thead><tr>' +
'<th id="headerName" class="hidden column-name">' +
- '<input type="checkbox" id="select_all_files" class="select-all">' +
+ '<input type="checkbox" id="select_all_files" class="select-all checkbox">' +
'<a class="name columntitle" data-sort="name"><span>Name</span><span class="sort-indicator"></span></a>' +
'<span id="selectedActionsList" class="selectedActions hidden">' +
'<a href class="download"><img src="actions/download.svg">Download</a>' +
@@ -1969,14 +1969,35 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.hasClass('highlighted')).toEqual(true);
expect(fileList._detailsView.getFileInfo().id).toEqual(1);
});
- it('keeps the last highlighted file when unselecting file using checkbox', function() {
+ it('removes last highlighted file when selecting via checkbox', function() {
var $tr = fileList.findFileEl('One.txt');
+
+ // select
+ $tr.find('td.filename>a.name').click();
$tr.find('input:checkbox').click();
- expect($tr.hasClass('highlighted')).toEqual(true);
+ expect($tr.hasClass('highlighted')).toEqual(false);
+
+ // deselect
+ $tr.find('td.filename>a.name').click();
$tr.find('input:checkbox').click();
+ expect($tr.hasClass('highlighted')).toEqual(false);
- expect($tr.hasClass('highlighted')).toEqual(true);
- expect(fileList._detailsView.getFileInfo().id).toEqual(1);
+ expect(fileList._detailsView.getFileInfo()).toEqual(null);
+ });
+ it('removes last highlighted file when selecting all files via checkbox', function() {
+ var $tr = fileList.findFileEl('One.txt');
+
+ // select
+ $tr.find('td.filename>a.name').click();
+ fileList.$el.find('.select-all.checkbox').click();
+ expect($tr.hasClass('highlighted')).toEqual(false);
+
+ // deselect
+ $tr.find('td.filename>a.name').click();
+ fileList.$el.find('.select-all.checkbox').click();
+ expect($tr.hasClass('highlighted')).toEqual(false);
+
+ expect(fileList._detailsView.getFileInfo()).toEqual(null);
});
it('closes sidebar whenever the currently highlighted file was removed from the list', function() {
var $tr = fileList.findFileEl('One.txt');