@@ -138,32 +138,30 @@ describe('IgxRadio', () => {
138138 expect ( nativeRadio . getAttribute ( 'aria-label' ) ) . toMatch ( fixture . componentInstance . label ) ;
139139 } ) ;
140140
141- it ( 'Disabled state' , ( ) => {
141+ it ( 'Disabled state' , fakeAsync ( ( ) => {
142142 const fixture = TestBed . createComponent ( DisabledRadioComponent ) ;
143143 fixture . detectChanges ( ) ;
144-
145144 const testInstance = fixture . componentInstance ;
146- const radios = testInstance . radios . toArray ( ) ;
147145
148146 // get the disabled radio button
149- const radioInstance = radios [ 1 ] ;
150- const nativeRadio = radioInstance . nativeRadio . nativeElement ;
151- const nativeLabel = radioInstance . nativeLabel . nativeElement ;
152- const placeholderLabel = radioInstance . placeholderLabel . nativeElement ;
147+ const componentInstance = testInstance . radios . last ;
148+ const radio = componentInstance . nativeRadio . nativeElement ;
153149
154- expect ( radios . length ) . toEqual ( 2 ) ;
155- expect ( radioInstance . disabled ) . toBe ( true ) ;
156- expect ( nativeRadio . disabled ) . toBe ( true ) ;
150+ expect ( componentInstance . disabled ) . toBe ( true ) ;
151+ expect ( radio . disabled ) . toBe ( true ) ;
157152
158- nativeRadio . dispatchEvent ( new Event ( 'change' ) ) ;
159- nativeLabel . click ( ) ;
160- placeholderLabel . click ( ) ;
153+ fixture . detectChanges ( ) ;
154+
155+ const btn = fixture . debugElement . queryAll ( By . css ( 'igx-radio' ) ) [ 1 ] ;
156+ btn . nativeElement . click ( ) ;
157+ tick ( ) ;
161158 fixture . detectChanges ( ) ;
162159
163160 // Should not update
164- expect ( nativeRadio . checked ) . toBe ( false ) ;
161+ expect ( componentInstance . nativeRadio . nativeElement . checked ) . toBe ( false ) ;
162+ expect ( radio . checked ) . toBe ( false ) ;
165163 expect ( testInstance . selected ) . not . toEqual ( 'Bar' ) ;
166- } ) ;
164+ } ) ) ;
167165
168166 it ( 'Required state' , ( ) => {
169167 const fixture = TestBed . createComponent ( RequiredRadioComponent ) ;
0 commit comments