Skip to content
Snippets Groups Projects
Commit bc598f19 authored by Vincent Petry's avatar Vincent Petry
Browse files

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
parent 85e67be0
Branches
No related tags found
No related merge requests found
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment