diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-03-04 10:48:08 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-03-04 10:48:08 +0100 |
commit | 3a36163e9187d7a65418350371c7b20303cae671 (patch) | |
tree | 294924352b210df35f4a7d459e6ce96d889dce94 /apps/files/tests | |
parent | bcc200cf9bb18ecb385ef617488555bdcc598312 (diff) | |
download | nextcloud-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.js | 20 |
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); + }); + }); }); |