File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export function main() {
6666 } , 10 ) ;
6767 } ) ;
6868 } ) ;
69+
6970 it ( 'should be updated correctly if the ngModel value is cleared.' , ( done ) => {
7071 var template = '<div><ig-combo [(widgetId)]="comboID" [(options)]="options" [changeDetectionInterval]="cdi" [(ngModel)]="combo.value1"></ig-combo></div>' ;
7172 TestBed . overrideComponent ( TestComponent , {
@@ -76,12 +77,16 @@ export function main() {
7677 TestBed . compileComponents ( ) . then ( ( ) => {
7778 let fixture = TestBed . createComponent ( TestComponent ) ;
7879 fixture . detectChanges ( ) ;
79- //clear
80- $ ( "#combo1" ) . find ( ".ui-igcombo-clearicon" ) . click ( ) ;
81- fixture . detectChanges ( ) ;
80+ fixture . componentInstance . combo . value1 = 1 ;
81+ fixture . detectChanges ( ) ;
8282 setTimeout ( function ( ) {
83- expect ( fixture . componentInstance . combo . value1 instanceof Array && fixture . componentInstance . combo . value1 . length === 0 ) . toBeTruthy ( ) ;
84- done ( ) ;
83+ //clear
84+ $ ( "#combo1" ) . parents ( "ig-combo" ) . find ( ".ui-igcombo-clearicon" ) . click ( ) ;
85+ fixture . detectChanges ( ) ;
86+ setTimeout ( function ( ) {
87+ expect ( fixture . componentInstance . combo . value1 instanceof Array && fixture . componentInstance . combo . value1 . length === 0 ) . toBeTruthy ( ) ;
88+ done ( ) ;
89+ } , 10 ) ;
8590 } , 10 ) ;
8691 } ) ;
8792 } ) ;
You can’t perform that action at this time.
0 commit comments