@@ -1153,6 +1153,22 @@ describe('igxCombo', () => {
11531153 caseSensitiveIcon = fixture . debugElement . query ( By . css ( 'igx-icon[name=\'case-sensitive\']' ) ) ;
11541154 expect ( caseSensitiveIcon ) . toBeNull ( ) ;
11551155 } ) ;
1156+ it ( 'should render the combo component with the id set and not throw an error' , ( ) => {
1157+ fixture = TestBed . createComponent ( ComboWithIdComponent ) ;
1158+ fixture . detectChanges ( ) ;
1159+
1160+ combo = fixture . componentInstance . combo ;
1161+ fixture . detectChanges ( ) ;
1162+
1163+ expect ( combo ) . toBeTruthy ( ) ;
1164+ expect ( combo . id ) . toEqual ( "id1" ) ;
1165+ fixture . detectChanges ( ) ;
1166+
1167+ const errorSpy = spyOn ( console , 'error' ) ;
1168+ fixture . detectChanges ( ) ;
1169+
1170+ expect ( errorSpy ) . not . toHaveBeenCalled ( ) ;
1171+ } ) ;
11561172 } ) ;
11571173 describe ( 'Positioning tests: ' , ( ) => {
11581174 let containerElement : any ;
@@ -3875,3 +3891,32 @@ export class ComboArrayTypeValueKeyComponent {
38753891 ] ;
38763892 }
38773893}
3894+
3895+ @Component ( {
3896+ template : `
3897+ <igx-combo id="id1" [data]="items" valueKey="value" displayKey="item"></igx-combo>` ,
3898+ standalone : true ,
3899+ imports : [ IgxComboComponent ]
3900+ } )
3901+ export class ComboWithIdComponent {
3902+ @ViewChild ( IgxComboComponent , { read : IgxComboComponent , static : true } )
3903+ public combo : IgxComboComponent ;
3904+ public items : any [ ] = [ ] ;
3905+
3906+ constructor ( ) {
3907+ this . items = [
3908+ {
3909+ item : "Item1" ,
3910+ value : "Option1"
3911+ } ,
3912+ {
3913+ item : "Item2" ,
3914+ value : "Option2"
3915+ } ,
3916+ {
3917+ item : "Item3" ,
3918+ value : "Option3" ,
3919+ }
3920+ ] ;
3921+ }
3922+ }
0 commit comments