aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js/fileactionsSpec.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-08-11 11:35:46 +0200
committerVincent Petry <pvince81@owncloud.com>2015-08-11 11:35:46 +0200
commit984ae8140d986e93a2fcea5951436e95c8e2c603 (patch)
tree3a44d5c7889ac77dd463e296a767517f93888f72 /apps/files/tests/js/fileactionsSpec.js
parenta5aa03a1a6c0f659c0528253d28c63f759d1ed50 (diff)
downloadnextcloud-server-984ae8140d986e93a2fcea5951436e95c8e2c603.tar.gz
nextcloud-server-984ae8140d986e93a2fcea5951436e95c8e2c603.zip
Fixed file actions menu to close when reclicking trigger
FileActionsMenu is now a backbone view. The trigger and highlight handling is now done in the FileActions.showMenu() method using events.
Diffstat (limited to 'apps/files/tests/js/fileactionsSpec.js')
-rw-r--r--apps/files/tests/js/fileactionsSpec.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index 8c43b917fa9..236cff6cafd 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -192,10 +192,26 @@ describe('OCA.Files.FileActions tests', function() {
context = actionStub.getCall(0).args[1];
expect(context.dir).toEqual('/somepath');
});
- it('shows actions menu when clicking the menu trigger', function() {
- expect($tr.find('.menu').length).toEqual(0);
- $tr.find('.action-menu').click();
- expect($tr.find('.menu').length).toEqual(1);
+ describe('actions menu', function() {
+ it('shows actions menu inside row when clicking the menu trigger', function() {
+ expect($tr.find('td.filename .fileActionsMenu').length).toEqual(0);
+ $tr.find('.action-menu').click();
+ expect($tr.find('td.filename .fileActionsMenu').length).toEqual(1);
+ });
+ it('shows highlight on current row', function() {
+ $tr.find('.action-menu').click();
+ expect($tr.hasClass('mouseOver')).toEqual(true);
+ });
+ it('cleans up after hiding', function() {
+ var clock = sinon.useFakeTimers();
+ $tr.find('.action-menu').click();
+ expect($tr.find('.fileActionsMenu').length).toEqual(1);
+ OC.hideMenus();
+ // sliding animation
+ clock.tick(500);
+ expect($tr.hasClass('mouseOver')).toEqual(false);
+ expect($tr.find('.fileActionsMenu').length).toEqual(0);
+ });
});
});
describe('custom rendering', function() {