summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-03-04 10:48:08 +0100
committerVincent Petry <pvince81@owncloud.com>2016-03-04 10:48:08 +0100
commit3a36163e9187d7a65418350371c7b20303cae671 (patch)
tree294924352b210df35f4a7d459e6ce96d889dce94 /apps/files/tests
parentbcc200cf9bb18ecb385ef617488555bdcc598312 (diff)
downloadnextcloud-server-3a36163e9187d7a65418350371c7b20303cae671.tar.gz
nextcloud-server-3a36163e9187d7a65418350371c7b20303cae671.zip
Fix download spinner to work with CSS styles
A recent change replaced img elements with CSS icons for file actions. This fix adjusts the logic to work properly with CSS icons instead of images.
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/fileactionsSpec.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index 470f2854f43..3f46a27d1f9 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -656,4 +656,24 @@ describe('OCA.Files.FileActions tests', function() {
});
});
});
+ describe('download spinner', function() {
+ var FileActions = OCA.Files.FileActions;
+ var $el;
+
+ beforeEach(function() {
+ $el = $('<a href="#"><span class="icon icon-download"></span><span>Download</span></a>');
+ });
+
+ it('replaces download icon with spinner', function() {
+ FileActions.updateFileActionSpinner($el, true);
+ expect($el.find('.icon.loading').length).toEqual(1);
+ expect($el.find('.icon.icon-download').hasClass('hidden')).toEqual(true);
+ });
+ it('replaces spinner back with download icon with spinner', function() {
+ FileActions.updateFileActionSpinner($el, true);
+ FileActions.updateFileActionSpinner($el, false);
+ expect($el.find('.icon.loading').length).toEqual(0);
+ expect($el.find('.icon.icon-download').hasClass('hidden')).toEqual(false);
+ });
+ });
});