@@ -856,4 +856,51 @@ export class AppModule { }`);
856856 }
857857 } ) ;
858858 } ) ;
859+
860+ describe ( 'Language Service migrations' , ( ) => {
861+
862+ it ( 'Should be able to replace property of an event' , ( ) => {
863+ pending ( 'set up tests for migrations through lang service' ) ;
864+ const membersConfig = {
865+ member : 'onGridKeydown' ,
866+ replaceWith : 'gridKeydown' ,
867+ definedIn : [
868+ 'IgxGridComponent' ,
869+ 'IgxTreeGridComponent' ,
870+ 'IgxHierarchicalGridComponent' ,
871+ 'IgxRowIslandComponent'
872+ ]
873+ } ;
874+ const fileContent =
875+ `import { Component } from '@angular/core';
876+ import { IGridCreatedEventArgs } from 'igniteui-angular';
877+ @Component({
878+ selector: 'app-custom-grid',
879+ template: ''
880+ })
881+ export class CustomGridComponent {
882+ public childGridCreated(event: IGridCreatedEventArgs) {
883+ event.grid.onGridKeydown.subscribe(() => {});
884+ }
885+ }
886+ ` ;
887+ appTree . create ( 'test.component.ts' , fileContent ) ;
888+ const expectedFileContent =
889+ `import { Component } from '@angular/core';
890+ import { IGridCreatedEventArgs } from 'igniteui-angular';
891+ @Component({
892+ selector: 'app-custom-grid',
893+ template: ''
894+ })
895+ export class CustomGridComponent {
896+ public childGridCreated(event: IGridCreatedEventArgs) {
897+ event.grid.gridKeydown.subscribe(() => {});
898+ }
899+ }
900+ ` ;
901+ const update = new UnitUpdateChanges ( __dirname , appTree ) ;
902+ update . applyChanges ( ) ;
903+ expect ( appTree . readContent ( 'test.component.ts' ) ) . toEqual ( expectedFileContent ) ;
904+ } ) ;
905+ } ) ;
859906} ) ;
0 commit comments