summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-04 14:50:11 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-04 14:50:11 +0100
commite56727e27b37ee4e55fea01913755b78638b8025 (patch)
treef7b61b07b15c447478e92eb2604d5e1c7aa1d157
parent299bcf749a63efa6516afeb3e826f087a31187e9 (diff)
parent3f6e7d6a43cd59d70886690e74f7da45dfbd3ec0 (diff)
downloadnextcloud-server-e56727e27b37ee4e55fea01913755b78638b8025.tar.gz
nextcloud-server-e56727e27b37ee4e55fea01913755b78638b8025.zip
Merge pull request #14690 from owncloud/trash-deletelink-unittest
Add unit test for selection overlay actions in trashbin
-rw-r--r--apps/files_trashbin/tests/js/filelistSpec.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js
index fd479234b30..9aa1f907fa9 100644
--- a/apps/files_trashbin/tests/js/filelistSpec.js
+++ b/apps/files_trashbin/tests/js/filelistSpec.js
@@ -220,6 +220,28 @@ describe('OCA.Trashbin.FileList tests', function() {
fileList.findFileEl('somedir.d99999').find('input:checkbox').click();
});
describe('Delete', function() {
+ it('Shows trashbin actions', function() {
+ // visible because a few files were selected
+ expect($('.selectedActions').is(':visible')).toEqual(true);
+ expect($('.selectedActions .delete-selected').is(':visible')).toEqual(true);
+ expect($('.selectedActions .undelete').is(':visible')).toEqual(true);
+
+ // check
+ fileList.$el.find('.select-all').click();
+
+ // stays visible
+ expect($('.selectedActions').is(':visible')).toEqual(true);
+ expect($('.selectedActions .delete-selected').is(':visible')).toEqual(true);
+ expect($('.selectedActions .undelete').is(':visible')).toEqual(true);
+
+ // uncheck
+ fileList.$el.find('.select-all').click();
+
+ // becomes hidden now
+ expect($('.selectedActions').is(':visible')).toEqual(false);
+ expect($('.selectedActions .delete-selected').is(':visible')).toEqual(false);
+ expect($('.selectedActions .undelete').is(':visible')).toEqual(false);
+ });
it('Deletes selected files when "Delete" clicked', function() {
var request;
$('.selectedActions .delete-selected').click();