summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
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);
+ });
+ });
});