summaryrefslogtreecommitdiff
path: root/spec/javascripts/right_sidebar_spec.js
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-08-08 16:19:46 -0500
committerClement Ho <ClemMakesApps@gmail.com>2016-10-26 16:28:56 -0500
commitf610f69ab92827c49e9cbb528cacc26af10be081 (patch)
treeca255d2f6aa66340a856b1fd8e013a74d46353a5 /spec/javascripts/right_sidebar_spec.js
parent5a4e6721786dd080cd40ca4ea23fc4202a85e73f (diff)
downloadgitlab-ce-f610f69ab92827c49e9cbb528cacc26af10be081.tar.gz
Add todo toggle event
Diffstat (limited to 'spec/javascripts/right_sidebar_spec.js')
-rw-r--r--spec/javascripts/right_sidebar_spec.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/javascripts/right_sidebar_spec.js b/spec/javascripts/right_sidebar_spec.js
index c937a4706f7..9c7f44c6427 100644
--- a/spec/javascripts/right_sidebar_spec.js
+++ b/spec/javascripts/right_sidebar_spec.js
@@ -3,6 +3,8 @@
/*= require jquery */
/*= require jquery.cookie */
+/*= require extensions/jquery.js */
+
(function() {
var $aside, $icon, $labelsIcon, $page, $toggle, assertSidebarState;
@@ -55,12 +57,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);