summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/tests/js/fileactionsSpec.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index 23f7b58dcd9..e185cf2f654 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -43,7 +43,18 @@ describe('FileActions tests', function() {
// actions defined after cal
expect($tr.find('.action[data-action=Download]').length).toEqual(1);
- expect($tr.find('.action[data-action=Rename]').length).toEqual(1);
+ expect($tr.find('.nametext .action[data-action=Rename]').length).toEqual(1);
+ expect($tr.find('.action.delete').length).toEqual(1);
+ });
+ it('calling display() twice correctly replaces file actions', function() {
+ var $tr = FileList.addFile('testName.txt', 1234, new Date(), false, false, {download_url: 'test/download/url'});
+
+ FileActions.display($tr.find('td.filename'), true);
+ FileActions.display($tr.find('td.filename'), true);
+
+ // actions defined after cal
+ expect($tr.find('.action[data-action=Download]').length).toEqual(1);
+ expect($tr.find('.nametext .action[data-action=Rename]').length).toEqual(1);
expect($tr.find('.action.delete').length).toEqual(1);
});
it('redirects to download URL when clicking download', function() {