diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-08-09 00:19:46 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2016-10-27 00:28:56 +0300 |
commit | f610f69ab92827c49e9cbb528cacc26af10be081 (patch) | |
tree | ca255d2f6aa66340a856b1fd8e013a74d46353a5 /spec/javascripts/right_sidebar_spec.js | |
parent | 5a4e6721786dd080cd40ca4ea23fc4202a85e73f (diff) |
Add todo toggle event
Diffstat (limited to 'spec/javascripts/right_sidebar_spec.js')
-rw-r--r-- | spec/javascripts/right_sidebar_spec.js | 19 |
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); |