@@ -18,7 +18,7 @@ describe('accordion', function () {
18
18
} ) ) ;
19
19
20
20
describe ( 'addGroup' , function ( ) {
21
- it ( 'adds a the specified group to the collection' , function ( ) {
21
+ it ( 'adds a the specified panel to the collection' , function ( ) {
22
22
var group1 , group2 ;
23
23
ctrl . addGroup ( group1 = $scope . $new ( ) ) ;
24
24
ctrl . addGroup ( group2 = $scope . $new ( ) ) ;
@@ -35,23 +35,23 @@ describe('accordion', function () {
35
35
ctrl . addGroup ( group2 = { isOpen : true , $on : angular . noop } ) ;
36
36
ctrl . addGroup ( group3 = { isOpen : true , $on : angular . noop } ) ;
37
37
} ) ;
38
- it ( 'should close other groups if close-others attribute is not defined' , function ( ) {
38
+ it ( 'should close other panels if close-others attribute is not defined' , function ( ) {
39
39
delete $attrs . closeOthers ;
40
40
ctrl . closeOthers ( group2 ) ;
41
41
expect ( group1 . isOpen ) . toBe ( false ) ;
42
42
expect ( group2 . isOpen ) . toBe ( true ) ;
43
43
expect ( group3 . isOpen ) . toBe ( false ) ;
44
44
} ) ;
45
45
46
- it ( 'should close other groups if close-others attribute is true' , function ( ) {
46
+ it ( 'should close other panels if close-others attribute is true' , function ( ) {
47
47
$attrs . closeOthers = 'true' ;
48
48
ctrl . closeOthers ( group3 ) ;
49
49
expect ( group1 . isOpen ) . toBe ( false ) ;
50
50
expect ( group2 . isOpen ) . toBe ( false ) ;
51
51
expect ( group3 . isOpen ) . toBe ( true ) ;
52
52
} ) ;
53
53
54
- it ( 'should not close other groups if close-others attribute is false' , function ( ) {
54
+ it ( 'should not close other panels if close-others attribute is false' , function ( ) {
55
55
$attrs . closeOthers = 'false' ;
56
56
ctrl . closeOthers ( group2 ) ;
57
57
expect ( group1 . isOpen ) . toBe ( true ) ;
@@ -70,7 +70,7 @@ describe('accordion', function () {
70
70
accordionConfig . closeOthers = originalCloseOthers ;
71
71
} ) ) ;
72
72
73
- it ( 'should not close other groups if accordionConfig.closeOthers is false' , function ( ) {
73
+ it ( 'should not close other panels if accordionConfig.closeOthers is false' , function ( ) {
74
74
ctrl . closeOthers ( group2 ) ;
75
75
expect ( group1 . isOpen ) . toBe ( true ) ;
76
76
expect ( group2 . isOpen ) . toBe ( true ) ;
@@ -80,7 +80,7 @@ describe('accordion', function () {
80
80
} ) ;
81
81
82
82
describe ( 'removeGroup' , function ( ) {
83
- it ( 'should remove the specified group ' , function ( ) {
83
+ it ( 'should remove the specified panel ' , function ( ) {
84
84
var group1 , group2 , group3 ;
85
85
ctrl . addGroup ( group1 = $scope . $new ( ) ) ;
86
86
ctrl . addGroup ( group2 = $scope . $new ( ) ) ;
@@ -90,7 +90,7 @@ describe('accordion', function () {
90
90
expect ( ctrl . groups [ 0 ] ) . toBe ( group1 ) ;
91
91
expect ( ctrl . groups [ 1 ] ) . toBe ( group3 ) ;
92
92
} ) ;
93
- it ( 'should ignore remove of non-existing group ' , function ( ) {
93
+ it ( 'should ignore remove of non-existing panel ' , function ( ) {
94
94
var group1 , group2 ;
95
95
ctrl . addGroup ( group1 = $scope . $new ( ) ) ;
96
96
ctrl . addGroup ( group2 = $scope . $new ( ) ) ;
@@ -109,7 +109,7 @@ describe('accordion', function () {
109
109
return groups . eq ( index ) . find ( 'a' ) . eq ( 0 ) ;
110
110
} ;
111
111
var findGroupBody = function ( index ) {
112
- return groups . eq ( index ) . find ( '.accordion-body ' ) . eq ( 0 ) ;
112
+ return groups . eq ( index ) . find ( '.panel-collapse ' ) . eq ( 0 ) ;
113
113
} ;
114
114
115
115
@@ -122,7 +122,7 @@ describe('accordion', function () {
122
122
element = groups = scope = $compile = undefined ;
123
123
} ) ;
124
124
125
- describe ( 'with static groups ' , function ( ) {
125
+ describe ( 'with static panels ' , function ( ) {
126
126
beforeEach ( function ( ) {
127
127
var tpl =
128
128
"<accordion>" +
@@ -133,13 +133,13 @@ describe('accordion', function () {
133
133
angular . element ( document . body ) . append ( element ) ;
134
134
$compile ( element ) ( scope ) ;
135
135
scope . $digest ( ) ;
136
- groups = element . find ( '.accordion-group ' ) ;
136
+ groups = element . find ( '.panel ' ) ;
137
137
} ) ;
138
138
afterEach ( function ( ) {
139
139
element . remove ( ) ;
140
140
} ) ;
141
141
142
- it ( 'should create accordion groups with content' , function ( ) {
142
+ it ( 'should create accordion panels with content' , function ( ) {
143
143
expect ( groups . length ) . toEqual ( 2 ) ;
144
144
expect ( findGroupLink ( 0 ) . text ( ) ) . toEqual ( 'title 1' ) ;
145
145
expect ( findGroupBody ( 0 ) . text ( ) . trim ( ) ) . toEqual ( 'Content 1' ) ;
@@ -168,7 +168,7 @@ describe('accordion', function () {
168
168
} ) ;
169
169
} ) ;
170
170
171
- describe ( 'with dynamic groups ' , function ( ) {
171
+ describe ( 'with dynamic panels ' , function ( ) {
172
172
var model ;
173
173
beforeEach ( function ( ) {
174
174
var tpl =
@@ -185,15 +185,15 @@ describe('accordion', function () {
185
185
scope . $digest ( ) ;
186
186
} ) ;
187
187
188
- it ( 'should have no groups initially' , function ( ) {
189
- groups = element . find ( '.accordion-group ' ) ;
188
+ it ( 'should have no panels initially' , function ( ) {
189
+ groups = element . find ( '.panel ' ) ;
190
190
expect ( groups . length ) . toEqual ( 0 ) ;
191
191
} ) ;
192
192
193
- it ( 'should have a group for each model item' , function ( ) {
193
+ it ( 'should have a panel for each model item' , function ( ) {
194
194
scope . groups = model ;
195
195
scope . $digest ( ) ;
196
- groups = element . find ( '.accordion-group ' ) ;
196
+ groups = element . find ( '.panel ' ) ;
197
197
expect ( groups . length ) . toEqual ( 2 ) ;
198
198
expect ( findGroupLink ( 0 ) . text ( ) ) . toEqual ( 'title 1' ) ;
199
199
expect ( findGroupBody ( 0 ) . text ( ) . trim ( ) ) . toEqual ( 'Content 1' ) ;
@@ -204,12 +204,12 @@ describe('accordion', function () {
204
204
it ( 'should react properly on removing items from the model' , function ( ) {
205
205
scope . groups = model ;
206
206
scope . $digest ( ) ;
207
- groups = element . find ( '.accordion-group ' ) ;
207
+ groups = element . find ( '.panel ' ) ;
208
208
expect ( groups . length ) . toEqual ( 2 ) ;
209
209
210
210
scope . groups . splice ( 0 , 1 ) ;
211
211
scope . $digest ( ) ;
212
- groups = element . find ( '.accordion-group ' ) ;
212
+ groups = element . find ( '.panel ' ) ;
213
213
expect ( groups . length ) . toEqual ( 1 ) ;
214
214
} ) ;
215
215
} ) ;
@@ -226,10 +226,10 @@ describe('accordion', function () {
226
226
scope . open2 = true ;
227
227
$compile ( element ) ( scope ) ;
228
228
scope . $digest ( ) ;
229
- groups = element . find ( '.accordion-group ' ) ;
229
+ groups = element . find ( '.panel ' ) ;
230
230
} ) ;
231
231
232
- it ( 'should open the group with isOpen set to true' , function ( ) {
232
+ it ( 'should open the panel with isOpen set to true' , function ( ) {
233
233
expect ( findGroupBody ( 0 ) . scope ( ) . isOpen ) . toBe ( false ) ;
234
234
expect ( findGroupBody ( 1 ) . scope ( ) . isOpen ) . toBe ( true ) ;
235
235
} ) ;
@@ -249,14 +249,14 @@ describe('accordion', function () {
249
249
angular . element ( document . body ) . append ( element ) ;
250
250
$compile ( element ) ( scope ) ;
251
251
scope . $digest ( ) ;
252
- groups = element . find ( '.accordion-group ' ) ;
252
+ groups = element . find ( '.panel ' ) ;
253
253
} ) ;
254
254
255
255
afterEach ( function ( ) {
256
256
element . remove ( ) ;
257
257
} ) ;
258
258
259
- it ( 'should have visible group body when the group with isOpen set to true' , function ( ) {
259
+ it ( 'should have visible panel body when the group with isOpen set to true' , function ( ) {
260
260
expect ( findGroupBody ( 0 ) [ 0 ] . clientHeight ) . not . toBe ( 0 ) ;
261
261
expect ( findGroupBody ( 1 ) [ 0 ] . clientHeight ) . toBe ( 0 ) ;
262
262
} ) ;
@@ -273,7 +273,7 @@ describe('accordion', function () {
273
273
'</accordion>' ;
274
274
element = $compile ( tpl ) ( scope ) ;
275
275
scope . $digest ( ) ;
276
- groups = element . find ( '.accordion-group ' ) ;
276
+ groups = element . find ( '.panel ' ) ;
277
277
} ) ;
278
278
it ( 'transcludes the <accordion-heading> content into the heading link' , function ( ) {
279
279
expect ( findGroupLink ( 0 ) . text ( ) ) . toBe ( 'Heading Element 123 ' ) ;
@@ -295,7 +295,7 @@ describe('accordion', function () {
295
295
'</accordion>' ;
296
296
element = $compile ( tpl ) ( scope ) ;
297
297
scope . $digest ( ) ;
298
- groups = element . find ( '.accordion-group ' ) ;
298
+ groups = element . find ( '.panel ' ) ;
299
299
} ) ;
300
300
it ( 'transcludes the <accordion-heading> content into the heading link' , function ( ) {
301
301
expect ( findGroupLink ( 0 ) . text ( ) ) . toBe ( 'Heading Element 123 ' ) ;
@@ -310,7 +310,7 @@ describe('accordion', function () {
310
310
it ( 'should clone the accordion-heading for each group' , function ( ) {
311
311
element = $compile ( '<accordion><accordion-group ng-repeat="x in [1,2,3]"><accordion-heading>{{x}}</accordion-heading></accordion-group></accordion>' ) ( scope ) ;
312
312
scope . $digest ( ) ;
313
- groups = element . find ( '.accordion-group ' ) ;
313
+ groups = element . find ( '.panel ' ) ;
314
314
expect ( groups . length ) . toBe ( 3 ) ;
315
315
expect ( findGroupLink ( 0 ) . text ( ) ) . toBe ( '1' ) ;
316
316
expect ( findGroupLink ( 1 ) . text ( ) ) . toBe ( '2' ) ;
@@ -323,7 +323,7 @@ describe('accordion', function () {
323
323
it ( 'should clone the accordion-heading for each group' , function ( ) {
324
324
element = $compile ( '<accordion><accordion-group ng-repeat="x in [1,2,3]"><div accordion-heading>{{x}}</div></accordion-group></accordion>' ) ( scope ) ;
325
325
scope . $digest ( ) ;
326
- groups = element . find ( '.accordion-group ' ) ;
326
+ groups = element . find ( '.panel ' ) ;
327
327
expect ( groups . length ) . toBe ( 3 ) ;
328
328
expect ( findGroupLink ( 0 ) . text ( ) ) . toBe ( '1' ) ;
329
329
expect ( findGroupLink ( 1 ) . text ( ) ) . toBe ( '2' ) ;
0 commit comments