File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,25 @@ export function main() {
6666 } , 10 ) ;
6767 } ) ;
6868 } ) ;
69+ it ( 'should be updated correctly if the ngModel value is cleared.' , ( done ) => {
70+ var template = '<div><ig-combo [(widgetId)]="comboID" [(options)]="options" [changeDetectionInterval]="cdi" [(ngModel)]="combo.value1"></ig-combo></div>' ;
71+ TestBed . overrideComponent ( TestComponent , {
72+ set : {
73+ template : template
74+ }
75+ } ) ;
76+ TestBed . compileComponents ( ) . then ( ( ) => {
77+ let fixture = TestBed . createComponent ( TestComponent ) ;
78+ fixture . detectChanges ( ) ;
79+ //clear
80+ $ ( "#combo1" ) . find ( ".ui-igcombo-clearicon" ) . click ( ) ;
81+ fixture . detectChanges ( ) ;
82+ setTimeout ( function ( ) {
83+ expect ( fixture . componentInstance . combo . value1 instanceof Array && fixture . componentInstance . combo . value1 . length === 0 ) . toBeTruthy ( ) ;
84+ done ( ) ;
85+ } , 10 ) ;
86+ } ) ;
87+ } ) ;
6988
7089 it ( 'the ngModel should be updated correctly if the combo selection is updated' , ( done ) => {
7190 var template = '<div><ig-combo [(widgetId)]="comboID" [(options)]="options" [changeDetectionInterval]="cdi" [(ngModel)]="combo.value1"></ig-combo></div>' ;
You can’t perform that action at this time.
0 commit comments