@@ -212,16 +212,18 @@ describe('dropdownToggle', function() {
212
212
describe ( '`on-toggle`' , function ( ) {
213
213
beforeEach ( function ( ) {
214
214
$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 ) ;
216
217
$rootScope . $digest ( ) ;
217
218
} ) ;
218
219
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 ( ) ;
221
222
} ) ;
222
223
223
224
it ( 'should call it correctly when toggles' , function ( ) {
224
- clickDropdownToggle ( ) ;
225
+ $rootScope . isopen = true ;
226
+ $rootScope . $digest ( ) ;
225
227
expect ( $rootScope . toggleHandler ) . toHaveBeenCalledWith ( true ) ;
226
228
227
229
clickDropdownToggle ( ) ;
@@ -237,8 +239,8 @@ describe('dropdownToggle', function() {
237
239
$rootScope . $digest ( ) ;
238
240
} ) ;
239
241
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 ( ) ;
242
244
} ) ;
243
245
244
246
it ( 'should call it correctly when toggles' , function ( ) {
0 commit comments