@@ -432,7 +432,8 @@ describe('IgxSimpleCombo', () => {
432
432
beforeAll ( waitForAsync ( ( ) => {
433
433
TestBed . configureTestingModule ( {
434
434
declarations : [
435
- IgxSimpleComboSampleComponent
435
+ IgxSimpleComboSampleComponent ,
436
+ IgxSimpleComboEmptyComponent
436
437
] ,
437
438
imports : [
438
439
IgxSimpleComboModule ,
@@ -631,6 +632,13 @@ describe('IgxSimpleCombo', () => {
631
632
expect ( footerHTMLElement . parentNode ) . toEqual ( dropdownList ) ;
632
633
expect ( footerHTMLElement . textContent ) . toEqual ( 'This is a footer' ) ;
633
634
} ) ;
635
+ it ( 'should initialize the component with empty data and bindings' , ( ) => {
636
+ fixture = TestBed . createComponent ( IgxSimpleComboEmptyComponent ) ;
637
+ expect ( ( ) => {
638
+ fixture . detectChanges ( ) ;
639
+ } ) . not . toThrow ( ) ;
640
+ expect ( fixture . componentInstance . combo ) . toBeDefined ( ) ;
641
+ } ) ;
634
642
} ) ;
635
643
636
644
describe ( 'Binding tests: ' , ( ) => {
@@ -1852,6 +1860,17 @@ class IgxSimpleComboSampleComponent {
1852
1860
}
1853
1861
}
1854
1862
1863
+ @Component ( {
1864
+ template : `<igx-simple-combo #combo [data]="data" displayKey="test" [(ngModel)]="name"></igx-simple-combo>`
1865
+ } )
1866
+ export class IgxSimpleComboEmptyComponent {
1867
+ @ViewChild ( 'combo' , { read : IgxSimpleComboComponent , static : true } )
1868
+ public combo : IgxSimpleComboComponent ;
1869
+
1870
+ public data : any [ ] = [ ] ;
1871
+ public name ! : string ;
1872
+ }
1873
+
1855
1874
@Component ( {
1856
1875
template : `<igx-simple-combo [(ngModel)]="selectedItem" [data]="items"></igx-simple-combo>`
1857
1876
} )
0 commit comments