@@ -212,16 +212,18 @@ describe('dropdownToggle', function() {
212212 describe ( '`on-toggle`' , function ( ) {
213213 beforeEach ( function ( ) {
214214 $rootScope . toggleHandler = jasmine . createSpy ( 'toggleHandler' ) ;
215- element = $compile ( '<li class="dropdown" on-toggle="toggleHandler(open)"><a dropdown-toggle></a><ul><li>Hello</li></ul></li>' ) ( $rootScope ) ;
215+ $rootScope . isopen = false ;
216+ element = $compile ( '<li class="dropdown" on-toggle="toggleHandler(open)" is-open="isopen"><a dropdown-toggle></a><ul><li>Hello</li></ul></li>' ) ( $rootScope ) ;
216217 $rootScope . $digest ( ) ;
217218 } ) ;
218219
219- it ( 'should be called initially' , function ( ) {
220- expect ( $rootScope . toggleHandler ) . toHaveBeenCalledWith ( false ) ;
220+ it ( 'should not have been called initially' , function ( ) {
221+ expect ( $rootScope . toggleHandler ) . not . toHaveBeenCalled ( ) ;
221222 } ) ;
222223
223224 it ( 'should call it correctly when toggles' , function ( ) {
224- clickDropdownToggle ( ) ;
225+ $rootScope . isopen = true ;
226+ $rootScope . $digest ( ) ;
225227 expect ( $rootScope . toggleHandler ) . toHaveBeenCalledWith ( true ) ;
226228
227229 clickDropdownToggle ( ) ;
@@ -237,8 +239,8 @@ describe('dropdownToggle', function() {
237239 $rootScope . $digest ( ) ;
238240 } ) ;
239241
240- it ( 'should be called initially with true ' , function ( ) {
241- expect ( $rootScope . toggleHandler ) . toHaveBeenCalledWith ( true ) ;
242+ it ( 'should not have been called initially ' , function ( ) {
243+ expect ( $rootScope . toggleHandler ) . not . toHaveBeenCalled ( ) ;
242244 } ) ;
243245
244246 it ( 'should call it correctly when toggles' , function ( ) {
0 commit comments