This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -230,5 +230,32 @@ describe('accordion', function () {
230
230
expect ( findGroupBody ( 1 ) . scope ( ) . isOpen ) . toBe ( true ) ;
231
231
} ) ;
232
232
} ) ;
233
+
234
+ describe ( 'is-open attribute with dynamic content' , function ( ) {
235
+ beforeEach ( function ( ) {
236
+ var tpl =
237
+ "<accordion>" +
238
+ "<accordion-group heading=\"title 1\" is-open=\"open1\"><div ng-repeat='item in items'>{{item}}</div></accordion-group>" +
239
+ "<accordion-group heading=\"title 2\" is-open=\"open2\">Static content</accordion-group>" +
240
+ "</accordion>" ;
241
+ element = angular . element ( tpl ) ;
242
+ scope . items = [ 'Item 1' , 'Item 2' , 'Item 3' ] ;
243
+ scope . open1 = true ;
244
+ scope . open2 = false ;
245
+ angular . element ( document . body ) . append ( element ) ;
246
+ $compile ( element ) ( scope ) ;
247
+ scope . $digest ( ) ;
248
+ groups = element . find ( '.accordion-group' ) ;
249
+ } ) ;
250
+
251
+ afterEach ( function ( ) {
252
+ element . remove ( ) ;
253
+ } ) ;
254
+
255
+ it ( 'should have visible group body when the group with isOpen set to true' , function ( ) {
256
+ expect ( findGroupBody ( 0 ) [ 0 ] . clientHeight ) . not . toBe ( 0 ) ;
257
+ expect ( findGroupBody ( 1 ) [ 0 ] . clientHeight ) . toBe ( 0 ) ;
258
+ } ) ;
259
+ } ) ;
233
260
} ) ;
234
261
} ) ;
You can’t perform that action at this time.
0 commit comments