Skip to content

Commit 0087fd3

Browse files
committed
Added test for touch to increase code coverage for menu extension
1 parent e42bd0c commit 0087fd3

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

test/spec.menu.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,22 @@ describe('Deck JS Menu', function() {
6363
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
6464
});
6565
});
66-
});
66+
67+
describe('touch bindings', function() {
68+
var estart;
69+
var eend;
70+
71+
beforeEach(function() {
72+
estart = jQuery.Event('touchstart.deckmenu');
73+
eend = jQuery.Event('touchend.deckmenu');
74+
});
75+
76+
it('should toggle the menu if the screen is touched', function() {
77+
$.deck('getOptions').touch.doubletapWindow = Date.now() + 100000;
78+
$.deck('getContainer').trigger(estart);
79+
$.deck('getContainer').trigger(eend);
80+
expect($(dsc)).toHaveClass(defaults.classes.menu);
81+
});
82+
});
83+
84+
});

0 commit comments

Comments
 (0)