@@ -133,32 +133,30 @@ describe('IgxRadio', () => {
133133 expect ( nativeRadio . getAttribute ( 'aria-label' ) ) . toMatch ( fixture . componentInstance . label ) ;
134134 } ) ;
135135
136- it ( 'Disabled state' , ( ) => {
136+ it ( 'Disabled state' , fakeAsync ( ( ) => {
137137 const fixture = TestBed . createComponent ( DisabledRadioComponent ) ;
138138 fixture . detectChanges ( ) ;
139-
140139 const testInstance = fixture . componentInstance ;
141- const radios = testInstance . radios . toArray ( ) ;
142140
143141 // get the disabled radio button
144- const radioInstance = radios [ 1 ] ;
145- const nativeRadio = radioInstance . nativeRadio . nativeElement ;
146- const nativeLabel = radioInstance . nativeLabel . nativeElement ;
147- const placeholderLabel = radioInstance . placeholderLabel . nativeElement ;
142+ const componentInstance = testInstance . radios . last ;
143+ const radio = componentInstance . nativeRadio . nativeElement ;
148144
149- expect ( radios . length ) . toEqual ( 2 ) ;
150- expect ( radioInstance . disabled ) . toBe ( true ) ;
151- expect ( nativeRadio . disabled ) . toBe ( true ) ;
145+ expect ( componentInstance . disabled ) . toBe ( true ) ;
146+ expect ( radio . disabled ) . toBe ( true ) ;
152147
153- nativeRadio . dispatchEvent ( new Event ( 'change' ) ) ;
154- nativeLabel . click ( ) ;
155- placeholderLabel . click ( ) ;
148+ fixture . detectChanges ( ) ;
149+
150+ const btn = fixture . debugElement . queryAll ( By . css ( 'igx-radio' ) ) [ 1 ] ;
151+ btn . nativeElement . click ( ) ;
152+ tick ( ) ;
156153 fixture . detectChanges ( ) ;
157154
158155 // Should not update
159- expect ( nativeRadio . checked ) . toBe ( false ) ;
156+ expect ( componentInstance . nativeRadio . nativeElement . checked ) . toBe ( false ) ;
157+ expect ( radio . checked ) . toBe ( false ) ;
160158 expect ( testInstance . selected ) . not . toEqual ( 'Bar' ) ;
161- } ) ;
159+ } ) ) ;
162160
163161 it ( 'Required state' , ( ) => {
164162 const fixture = TestBed . createComponent ( RequiredRadioComponent ) ;
0 commit comments