@@ -4,6 +4,8 @@ import {Component, ViewChild, TemplateRef} from '@angular/core';
44import { FormsModule } from '@angular/forms' ;
55import * as Infragistics from '../../../src/igniteui.angular2' ;
66
7+ import { dispatchEvent } from '@angular/platform-browser/testing/browser_util' ;
8+
79export function main ( ) {
810 describe ( 'Infragistics Angular2 TextEditor' , ( ) => {
911
@@ -54,8 +56,11 @@ export function main() {
5456 window . typeInInput ( "2" , field ) ;
5557 expect ( fixture . debugElement . componentInstance . val ) . toBe ( "changed_test_value22" ) ;
5658 field . val ( "changed_again_test_value" ) . trigger ( "paste" ) . trigger ( "blur" ) ;
59+ dispatchEvent ( $ ( fixture . debugElement . nativeElement ) . find ( "#editor1" ) [ 0 ] , "blur" ) ;
60+ fixture . detectChanges ( ) ;
5761 setTimeout ( ( ) => {
5862 expect ( fixture . debugElement . componentInstance . val ) . toBe ( "changed_again_test_value" ) ;
63+ expect ( $ ( fixture . debugElement . nativeElement ) . find ( "ig-text-editor" ) . hasClass ( "ng-touched" ) ) . toBe ( true ) ;
5964 done ( ) ;
6065 } , 100 ) ;
6166 } , 1 ) ;
@@ -128,8 +133,11 @@ export function main() {
128133 setTimeout ( ( ) => {
129134 expect ( $ ( fixture . debugElement . nativeElement ) . find ( "#editor1" ) . igNumericEditor ( "displayValue" ) ) . toBe ( "1" ) ;
130135 $ ( fixture . debugElement . nativeElement ) . find ( "#editor1" ) . trigger ( "focus" ) . val ( 154 ) . trigger ( "paste" ) . trigger ( "blur" ) ;
136+ dispatchEvent ( $ ( fixture . debugElement . nativeElement ) . find ( "#editor1" ) [ 0 ] , "blur" ) ;
137+ fixture . detectChanges ( ) ;
131138 setTimeout ( ( ) => {
132139 expect ( fixture . debugElement . componentInstance . val ) . toBe ( 154 ) ;
140+ expect ( $ ( fixture . debugElement . nativeElement ) . find ( "ig-numeric-editor" ) . hasClass ( "ng-touched" ) ) . toBe ( true ) ;
133141 done ( ) ;
134142 } , 100 ) ;
135143 } , 1 ) ;
0 commit comments