@@ -700,6 +700,73 @@ public onBannerOpened(event: BannerEventArgs) {
700700 }` ) ;
701701 } ) ;
702702
703+ // Transaction providers
704+ it ( 'Should add a comment for the deprecated IgxGridTransactionToken' , async ( ) => {
705+ appTree . create (
706+ '/testSrc/appPrefix/component/transaction.component.ts' , `
707+ import { IgxGridComponent, IgxGridTransaction, IgxTransactionService } from 'igniteui-angular';
708+ @Component({
709+ template: '',
710+ providers: [{ provide: IgxGridTransaction, useClass: IgxTransactionService }]
711+ })
712+ export class TransactionComponent {
713+ @ViewChild(IgxGridComponent, { read: IgxGridComponent })
714+ public IgxGridTransaction!: IgxGridComponent;
715+ }` ) ;
716+ const tree = await schematicRunner . runSchematicAsync ( migrationName , { } , appTree )
717+ . toPromise ( ) ;
718+
719+ expect ( tree . readContent ( '/testSrc/appPrefix/component/transaction.component.ts' ) )
720+ . toEqual ( `
721+ import { IgxGridComponent, IgxGridTransaction, IgxTransactionService } from 'igniteui-angular';
722+ @Component({
723+ template: '',
724+ providers: [/* Injection token 'IgxGridTransaction' has been deprecated. Please refer to the update guide for more details. */
725+ { provide: IgxGridTransaction, useClass: IgxTransactionService }]
726+ })
727+ export class TransactionComponent {
728+ @ViewChild(IgxGridComponent, { read: IgxGridComponent })
729+ public IgxGridTransaction!: IgxGridComponent;
730+ }` ) ;
731+ } ) ;
732+
733+ it ( 'Should add a comment for the deprecated IgxGridTransactionToken, multiple providers' , async ( ) => {
734+ appTree . create (
735+ '/testSrc/appPrefix/component/transaction.component.ts' , `
736+ import { IgxGridComponent, IgxGridTransaction, IgxTransactionService } from 'igniteui-angular';
737+ @Component({
738+ template: '',
739+ providers: [
740+ { provider: A, useClass: AService },
741+ { provide: IgxGridTransaction, useClass: IgxTransactionService },
742+ { provider: B, useClass: BService}
743+ ]
744+ })
745+ export class TransactionComponent {
746+ @ViewChild(IgxGridComponent, { read: IgxGridComponent })
747+ public IgxGridTransaction!: IgxGridComponent;
748+ }` ) ;
749+ const tree = await schematicRunner . runSchematicAsync ( migrationName , { } , appTree )
750+ . toPromise ( ) ;
751+
752+ expect ( tree . readContent ( '/testSrc/appPrefix/component/transaction.component.ts' ) )
753+ . toEqual ( `
754+ import { IgxGridComponent, IgxGridTransaction, IgxTransactionService } from 'igniteui-angular';
755+ @Component({
756+ template: '',
757+ providers: [
758+ { provider: A, useClass: AService },
759+ /* Injection token 'IgxGridTransaction' has been deprecated. Please refer to the update guide for more details. */
760+ { provide: IgxGridTransaction, useClass: IgxTransactionService },
761+ { provider: B, useClass: BService}
762+ ]
763+ })
764+ export class TransactionComponent {
765+ @ViewChild(IgxGridComponent, { read: IgxGridComponent })
766+ public IgxGridTransaction!: IgxGridComponent;
767+ }` ) ;
768+ } ) ;
769+
703770 it ( 'Should properly rename IComboSelectionChangeEventArgs to IComboSelectionChangingEventArgs' , async ( ) => {
704771 appTree . create ( '/testSrc/appPrefix/component/test.component.ts' ,
705772 `
@@ -751,4 +818,3 @@ public onBannerOpened(event: BannerEventArgs) {
751818 } ) ;
752819} ) ;
753820
754-
0 commit comments