diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-29 13:08:04 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-30 10:07:08 +0100 |
commit | bc598f19194e84dab815841dfe4544de1cf6f908 (patch) | |
tree | 52ed71f6f7c8cee2f95ccab6ae415fbacba4bda6 | |
parent | 85e67be0aa94d82ef29c2a68009b3897e4bcd63b (diff) | |
download | nextcloud-server-bc598f19194e84dab815841dfe4544de1cf6f908.tar.gz nextcloud-server-bc598f19194e84dab815841dfe4544de1cf6f908.zip |
Updated unit tests for rename action
- rename action is now checked inside of ".nametext" element
- added test to ensure that display() correctly resets all actions
including the rename one
-rw-r--r-- | apps/files/tests/js/fileactionsSpec.js | 13 |
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() { |