@@ -74,7 +74,7 @@ describe('ionNavBar', function() {
74
74
expect ( $scope . backButtonShown ) . toBe ( false ) ;
75
75
} ) ;
76
76
77
- it ( 'should showBar ' , function ( ) {
77
+ it ( 'showBar should set isInvisible ' , function ( ) {
78
78
var ctrl = setup ( ) ;
79
79
expect ( $scope . isInvisible ) . toBeUndefined ( ) ;
80
80
ctrl . showBar ( true ) ;
@@ -83,6 +83,15 @@ describe('ionNavBar', function() {
83
83
expect ( $scope . isInvisible ) . toBe ( true ) ;
84
84
} ) ;
85
85
86
+ it ( 'showBar should set $parent.$hasHeader' , function ( ) {
87
+ var ctrl = setup ( ) ;
88
+ expect ( $scope . $parent . $hasHeader ) . toBeUndefined ( ) ;
89
+ ctrl . showBar ( true ) ;
90
+ expect ( $scope . $parent . $hasHeader ) . toBe ( true ) ;
91
+ ctrl . showBar ( false ) ;
92
+ expect ( $scope . $parent . $hasHeader ) . toBe ( false ) ;
93
+ } ) ;
94
+
86
95
it ( 'should setTitle' , function ( ) {
87
96
var ctrl = setup ( ) ;
88
97
expect ( $scope . title ) . toBeFalsy ( ) ;
@@ -230,10 +239,10 @@ describe('ionNavBar', function() {
230
239
expect ( el . children ( ) . eq ( 0 ) . html ( ) ) . toBe ( '<b>super</b> content 4' ) ;
231
240
} ) ;
232
241
233
- it ( 'should $parent.$hasHeader and unset on $destroy' , function ( ) {
242
+ it ( 'should set $parent.$hasHeader to false on $scope. $destroy' , function ( ) {
234
243
var el = setup ( ) ;
235
244
var parentScope = el . scope ( ) . $parent ;
236
- expect ( parentScope . $hasHeader ) . toBe ( true ) ;
245
+ parentScope . $hasHeader = true ;
237
246
el . scope ( ) . $destroy ( ) ;
238
247
expect ( parentScope . $hasHeader ) . toBe ( false ) ;
239
248
} ) ;
@@ -255,6 +264,7 @@ describe('ionNavBar', function() {
255
264
256
265
it ( 'should have invisible class (default true)' , function ( ) {
257
266
var el = setup ( ) ;
267
+ el . scope ( ) . $apply ( ) ;
258
268
expect ( el . hasClass ( 'invisible' ) ) . toBe ( true ) ;
259
269
el . scope ( ) . $apply ( 'isInvisible = false' ) ;
260
270
expect ( el . hasClass ( 'invisible' ) ) . toBe ( false ) ;
0 commit comments