@@ -33,16 +33,16 @@ describe('IgxRadioGroupDirective', () => {
3333 fixture . detectChanges ( ) ;
3434 tick ( ) ;
3535
36- expect ( radioInstance . radioButtons ) . toBeDefined ( ) ;
37- expect ( radioInstance . radioButtons . length ) . toEqual ( 3 ) ;
36+ expect ( radioInstance . radioButtons ( ) ) . toBeDefined ( ) ;
37+ expect ( radioInstance . radioButtons ( ) . length ) . toEqual ( 3 ) ;
3838
39- const allRequiredButtons = radioInstance . radioButtons . filter ( ( btn ) => btn . required ) ;
40- expect ( allRequiredButtons . length ) . toEqual ( radioInstance . radioButtons . length ) ;
39+ const allRequiredButtons = radioInstance . radioButtons ( ) . filter ( ( btn ) => btn . required ) ;
40+ expect ( allRequiredButtons . length ) . toEqual ( radioInstance . radioButtons ( ) . length ) ;
4141
42- const allButtonsWithGroupName = radioInstance . radioButtons . filter ( ( btn ) => btn . name === radioInstance . name ) ;
43- expect ( allButtonsWithGroupName . length ) . toEqual ( radioInstance . radioButtons . length ) ;
42+ const allButtonsWithGroupName = radioInstance . radioButtons ( ) . filter ( ( btn ) => btn . name === radioInstance . name ) ;
43+ expect ( allButtonsWithGroupName . length ) . toEqual ( radioInstance . radioButtons ( ) . length ) ;
4444
45- const buttonWithGroupValue = radioInstance . radioButtons . find ( ( btn ) => btn . value === radioInstance . value ) ;
45+ const buttonWithGroupValue = radioInstance . radioButtons ( ) . find ( ( btn ) => btn . value === radioInstance . value ) ;
4646 expect ( buttonWithGroupValue ) . toBeDefined ( ) ;
4747 expect ( buttonWithGroupValue ) . toEqual ( radioInstance . selected ) ;
4848 } ) ) ;
@@ -64,28 +64,28 @@ describe('IgxRadioGroupDirective', () => {
6464 fixture . detectChanges ( ) ;
6565 tick ( ) ;
6666
67- expect ( radioInstance . radioButtons ) . toBeDefined ( ) ;
67+ expect ( radioInstance . radioButtons ( ) ) . toBeDefined ( ) ;
6868
6969 // name
7070 radioInstance . name = 'newGroupName' ;
7171 fixture . detectChanges ( ) ;
7272
73- const allButtonsWithNewName = radioInstance . radioButtons . filter ( ( btn ) => btn . name === 'newGroupName' ) ;
74- expect ( allButtonsWithNewName . length ) . toEqual ( radioInstance . radioButtons . length ) ;
73+ const allButtonsWithNewName = radioInstance . radioButtons ( ) . filter ( ( btn ) => btn . name === 'newGroupName' ) ;
74+ expect ( allButtonsWithNewName . length ) . toEqual ( radioInstance . radioButtons ( ) . length ) ;
7575
7676 // required
7777 radioInstance . required = true ;
7878 fixture . detectChanges ( ) ;
7979
80- const allRequiredButtons = radioInstance . radioButtons . filter ( ( btn ) => btn . required ) ;
81- expect ( allRequiredButtons . length ) . toEqual ( radioInstance . radioButtons . length ) ;
80+ const allRequiredButtons = radioInstance . radioButtons ( ) . filter ( ( btn ) => btn . required ) ;
81+ expect ( allRequiredButtons . length ) . toEqual ( radioInstance . radioButtons ( ) . length ) ;
8282
8383 // invalid
8484 radioInstance . invalid = true ;
8585 fixture . detectChanges ( ) ;
8686
87- const allInvalidButtons = radioInstance . radioButtons . filter ( ( btn ) => btn . invalid ) ;
88- expect ( allInvalidButtons . length ) . toEqual ( radioInstance . radioButtons . length ) ;
87+ const allInvalidButtons = radioInstance . radioButtons ( ) . filter ( ( btn ) => btn . invalid ) ;
88+ expect ( allInvalidButtons . length ) . toEqual ( radioInstance . radioButtons ( ) . length ) ;
8989 } ) ) ;
9090
9191 it ( 'Set value should change selected property' , fakeAsync ( ( ) => {
@@ -99,15 +99,15 @@ describe('IgxRadioGroupDirective', () => {
9999 expect ( radioInstance . value ) . toEqual ( 'Baz' ) ;
100100
101101 expect ( radioInstance . selected ) . toBeDefined ( ) ;
102- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . last ) ;
102+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ radioInstance . radioButtons ( ) . length - 1 ] ) ;
103103
104104 spyOn ( radioInstance . change , 'emit' ) ;
105105
106106 radioInstance . value = 'Foo' ;
107107 fixture . detectChanges ( ) ;
108108
109109 expect ( radioInstance . value ) . toEqual ( 'Foo' ) ;
110- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . first ) ;
110+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ 0 ] ) ;
111111 expect ( radioInstance . change . emit ) . not . toHaveBeenCalled ( ) ;
112112 } ) ) ;
113113
@@ -122,15 +122,15 @@ describe('IgxRadioGroupDirective', () => {
122122 expect ( radioInstance . value ) . toEqual ( 'Baz' ) ;
123123
124124 expect ( radioInstance . selected ) . toBeDefined ( ) ;
125- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . last ) ;
125+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ radioInstance . radioButtons ( ) . length - 1 ] ) ;
126126
127127 spyOn ( radioInstance . change , 'emit' ) ;
128128
129- radioInstance . selected = radioInstance . radioButtons . first ;
129+ radioInstance . selected = radioInstance . radioButtons ( ) [ 0 ] ;
130130 fixture . detectChanges ( ) ;
131131
132132 expect ( radioInstance . value ) . toEqual ( 'Foo' ) ;
133- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . first ) ;
133+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ 0 ] ) ;
134134 expect ( radioInstance . change . emit ) . not . toHaveBeenCalled ( ) ;
135135 } ) ) ;
136136
@@ -141,12 +141,12 @@ describe('IgxRadioGroupDirective', () => {
141141 fixture . detectChanges ( ) ;
142142 tick ( ) ;
143143
144- radioInstance . radioButtons . first . nativeLabel . nativeElement . click ( ) ;
144+ radioInstance . radioButtons ( ) [ 0 ] . nativeLabel . nativeElement . click ( ) ;
145145 fixture . detectChanges ( ) ;
146146 tick ( ) ;
147147
148148 expect ( radioInstance . value ) . toEqual ( 'Winter' ) ;
149- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . first ) ;
149+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ 0 ] ) ;
150150 } ) ) ;
151151
152152 it ( 'Updating the model should select a radio button.' , fakeAsync ( ( ) => {
@@ -161,7 +161,7 @@ describe('IgxRadioGroupDirective', () => {
161161 tick ( ) ;
162162
163163 expect ( radioInstance . value ) . toEqual ( 'Winter' ) ;
164- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . first ) ;
164+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ 0 ] ) ;
165165 } ) ) ;
166166
167167 it ( 'Properly update the model when radio group is hosted in Reactive forms.' , fakeAsync ( ( ) => {
@@ -191,7 +191,7 @@ describe('IgxRadioGroupDirective', () => {
191191
192192 const radioGroup = fixture . componentInstance . radioGroup ;
193193 expect ( radioGroup . value ) . toEqual ( 0 ) ;
194- expect ( radioGroup . radioButtons . first . checked ) . toEqual ( true ) ;
194+ expect ( radioGroup . radioButtons ( ) [ 0 ] . checked ) . toEqual ( true ) ;
195195 } ) ) ;
196196
197197 it ( 'Properly rebind dynamically added components' , fakeAsync ( ( ) => {
@@ -204,12 +204,12 @@ describe('IgxRadioGroupDirective', () => {
204204 fixture . detectChanges ( ) ;
205205 tick ( ) ;
206206
207- radioInstance . radioButtons . last . nativeLabel . nativeElement . click ( ) ;
207+ radioInstance . radioButtons ( ) [ radioInstance . radioButtons ( ) . length - 1 ] . nativeLabel . nativeElement . click ( ) ;
208208 fixture . detectChanges ( ) ;
209209 tick ( ) ;
210210
211211 expect ( radioInstance . value ) . toEqual ( 7 ) ;
212- expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons . last ) ;
212+ expect ( radioInstance . selected ) . toEqual ( radioInstance . radioButtons ( ) [ radioInstance . radioButtons ( ) . length - 1 ] ) ;
213213 } ) ) ;
214214
215215 it ( 'Updates checked radio button correctly' , fakeAsync ( ( ) => {
@@ -218,15 +218,15 @@ describe('IgxRadioGroupDirective', () => {
218218 tick ( ) ;
219219
220220 const radioGroup = fixture . componentInstance . radioGroup ;
221- expect ( radioGroup . radioButtons . first . checked ) . toEqual ( true ) ;
222- expect ( radioGroup . radioButtons . last . checked ) . toEqual ( false ) ;
221+ expect ( radioGroup . radioButtons ( ) [ 0 ] . checked ) . toEqual ( true ) ;
222+ expect ( radioGroup . radioButtons ( ) [ radioGroup . radioButtons ( ) . length - 1 ] . checked ) . toEqual ( false ) ;
223223
224- radioGroup . radioButtons . last . select ( ) ;
224+ radioGroup . radioButtons ( ) [ radioGroup . radioButtons ( ) . length - 1 ] . select ( ) ;
225225 fixture . detectChanges ( ) ;
226226 tick ( ) ;
227227
228- expect ( radioGroup . radioButtons . first . checked ) . toEqual ( false ) ;
229- expect ( radioGroup . radioButtons . last . checked ) . toEqual ( true ) ;
228+ expect ( radioGroup . radioButtons ( ) [ 0 ] . checked ) . toEqual ( false ) ;
229+ expect ( radioGroup . radioButtons ( ) [ radioGroup . radioButtons ( ) . length - 1 ] . checked ) . toEqual ( true ) ;
230230 } ) ) ;
231231
232232 it ( 'Should update styles correctly when required radio group\'s value is set.' , fakeAsync ( ( ) => {
@@ -252,13 +252,13 @@ describe('IgxRadioGroupDirective', () => {
252252 dispatchRadioEvent ( 'keyup' , domRadio , fixture ) ;
253253 expect ( domRadio . classList . contains ( 'igx-radio--focused' ) ) . toBe ( true ) ;
254254
255- radioGroup . radioButtons . first . select ( ) ;
255+ radioGroup . radioButtons ( ) [ 0 ] . select ( ) ;
256256 fixture . detectChanges ( ) ;
257257 tick ( ) ;
258258
259259 expect ( domRadio . classList . contains ( 'igx-radio--checked' ) ) . toBe ( true ) ;
260260 expect ( radioGroup . invalid ) . toBe ( false ) ;
261- expect ( radioGroup . radioButtons . first . checked ) . toEqual ( true ) ;
261+ expect ( radioGroup . radioButtons ( ) [ 0 ] . checked ) . toEqual ( true ) ;
262262 expect ( domRadio . classList . contains ( 'igx-radio--invalid' ) ) . toBe ( false ) ;
263263 } ) ) ;
264264} ) ;
@@ -448,3 +448,4 @@ const dispatchRadioEvent = (eventName, radioNativeElement, fixture) => {
448448 radioNativeElement . dispatchEvent ( new Event ( eventName ) ) ;
449449 fixture . detectChanges ( ) ;
450450} ;
451+
0 commit comments