@@ -1154,6 +1154,22 @@ describe('igxCombo', () => {
11541154 caseSensitiveIcon = fixture . debugElement . query ( By . css ( 'igx-icon[name=\'case-sensitive\']' ) ) ;
11551155 expect ( caseSensitiveIcon ) . toBeNull ( ) ;
11561156 } ) ;
1157+ it ( 'should render the combo component with the id set and not throw an error' , ( ) => {
1158+ fixture = TestBed . createComponent ( ComboWithIdComponent ) ;
1159+ fixture . detectChanges ( ) ;
1160+
1161+ combo = fixture . componentInstance . combo ;
1162+ fixture . detectChanges ( ) ;
1163+
1164+ expect ( combo ) . toBeTruthy ( ) ;
1165+ expect ( combo . id ) . toEqual ( "id1" ) ;
1166+ fixture . detectChanges ( ) ;
1167+
1168+ const errorSpy = spyOn ( console , 'error' ) ;
1169+ fixture . detectChanges ( ) ;
1170+
1171+ expect ( errorSpy ) . not . toHaveBeenCalled ( ) ;
1172+ } ) ;
11571173 } ) ;
11581174 describe ( 'Positioning tests: ' , ( ) => {
11591175 let containerElement : any ;
@@ -3846,3 +3862,32 @@ export class ComboArrayTypeValueKeyComponent {
38463862 ] ;
38473863 }
38483864}
3865+
3866+ @Component ( {
3867+ template : `
3868+ <igx-combo id="id1" [data]="items" valueKey="value" displayKey="item"></igx-combo>` ,
3869+ standalone : true ,
3870+ imports : [ IgxComboComponent ]
3871+ } )
3872+ export class ComboWithIdComponent {
3873+ @ViewChild ( IgxComboComponent , { read : IgxComboComponent , static : true } )
3874+ public combo : IgxComboComponent ;
3875+ public items : any [ ] = [ ] ;
3876+
3877+ constructor ( ) {
3878+ this . items = [
3879+ {
3880+ item : "Item1" ,
3881+ value : "Option1"
3882+ } ,
3883+ {
3884+ item : "Item2" ,
3885+ value : "Option2"
3886+ } ,
3887+ {
3888+ item : "Item3" ,
3889+ value : "Option3" ,
3890+ }
3891+ ] ;
3892+ }
3893+ }
0 commit comments