summaryrefslogtreecommitdiff
path: root/spec/javascripts/right_sidebar_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/right_sidebar_spec.js')
-rw-r--r--spec/javascripts/right_sidebar_spec.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/javascripts/right_sidebar_spec.js b/spec/javascripts/right_sidebar_spec.js
index 38b3b2653ec..ef03d1147de 100644
--- a/spec/javascripts/right_sidebar_spec.js
+++ b/spec/javascripts/right_sidebar_spec.js
@@ -1,11 +1,10 @@
+/* eslint-disable */
/*= require right_sidebar */
-
-
/*= require jquery */
+/*= require js.cookie */
-
-/*= require jquery.cookie */
+/*= require extensions/jquery.js */
(function() {
var $aside, $icon, $labelsIcon, $page, $toggle, assertSidebarState;
@@ -59,12 +58,27 @@
$labelsIcon.click();
return assertSidebarState('expanded');
});
- return it('should collapse when the icon arrow clicked while it is floating on page', function() {
+ it('should collapse when the icon arrow clicked while it is floating on page', function() {
$labelsIcon.click();
assertSidebarState('expanded');
$toggle.click();
return assertSidebarState('collapsed');
});
+
+ it('should broadcast todo:toggle event when add todo clicked', function() {
+ spyOn(jQuery, 'ajax').and.callFake(function() {
+ var d = $.Deferred();
+ var response = fixture.load('todos.json');
+ d.resolve(response);
+ return d.promise();
+ });
+
+ var todoToggleSpy = spyOnEvent(document, 'todo:toggle');
+
+ $('.js-issuable-todo').click();
+
+ expect(todoToggleSpy.calls.count()).toEqual(1);
+ })
});
}).call(this);