@@ -179,6 +179,35 @@ export function main() {
179179 } ) ;
180180 } ) ;
181181
182+ it ( 'the ngModel should be updated correctly if the combo is allowing custom values' , ( done ) => {
183+ var template = '<div><ig-combo [(widgetId)]="comboID" [(options)]="options" [(ngModel)]="combo.value1" [dataSource]="northwind" [allowCustomValue]="true"></ig-combo></div>' ;
184+ TestBed . overrideComponent ( TestComponent , {
185+ set : {
186+ template : template
187+ }
188+ } ) ;
189+ TestBed . compileComponents ( ) . then ( ( ) => {
190+ let fixture = TestBed . createComponent ( TestComponent ) ;
191+ fixture . detectChanges ( ) ;
192+ setTimeout ( function ( ) {
193+ //var elem = $("#combo1").igCombo("itemsFromIndex", 0)["element"];
194+ //$("#combo1").igCombo("select", elem, {}, true);
195+ $ ( fixture . debugElement . nativeElement ) . find ( "#combo1" ) . val ( "foo" ) . trigger ( "input" ) ;
196+ fixture . detectChanges ( ) ;
197+ setTimeout ( function ( ) {
198+ expect ( fixture . componentInstance . combo . value1 ) . toEqual ( "foo" ) ;
199+ //clear
200+ $ ( "#combo1" ) . parents ( "ig-combo" ) . find ( ".ui-igcombo-clearicon" ) . click ( ) ;
201+ fixture . detectChanges ( ) ;
202+ setTimeout ( function ( ) {
203+ expect ( fixture . componentInstance . combo . value1 ) . toBeNull ( ) ;
204+ done ( ) ;
205+ } , 10 ) ;
206+ } , 10 ) ;
207+ } , 100 ) ;
208+ } ) ;
209+ } ) ;
210+
182211 it ( 'the ngModel should be updated correctly if the combo selection is updated and multiple items are selected' , ( done ) => {
183212 var template = '<div><ig-combo [(widgetId)]="comboID" [dataSource]="northwind" [(options)]="optionsMultipleSelection" [(ngModel)]="combo.value1"></ig-combo></div>' ;
184213 TestBed . overrideComponent ( TestComponent , {
0 commit comments