Skip to content

Commit 3fb1d01

Browse files
authored
Merge pull request #9918 from IgniteUI/nalipiev/event-renaming-migrations
chore(migrations): add event renaming for combo and autocomplete
2 parents 959cd87 + 59b38d6 commit 3fb1d01

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

projects/igniteui-angular/migrations/update-12_1_0/changes/classes.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
{
1616
"name": "IgxGridExpandableCellComponent",
1717
"replaceWith": "CellType"
18+
},
19+
{
20+
"name": "IComboSelectionChangeEventArgs",
21+
"replaceWith": "IComboSelectionChangingEventArgs"
22+
},
23+
{
24+
"name": "AutocompleteItemSelectionEventArgs",
25+
"replaceWith": "AutocompleteSelectionChangingEventArgs"
1826
}
1927
]
20-
}
28+
}

projects/igniteui-angular/migrations/update-12_1_0/index.spec.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,56 @@ public onBannerOpened(event: BannerEventArgs) {
699699
}
700700
}`);
701701
});
702+
703+
it('Should properly rename IComboSelectionChangeEventArgs to IComboSelectionChangingEventArgs', async () => {
704+
appTree.create('/testSrc/appPrefix/component/test.component.ts',
705+
`
706+
import { IComboSelectionChangeEventArgs } from 'igniteui-angular';
707+
export class MyClass {
708+
public eventArgs: IComboSelectionChangeEventArgs;
709+
}
710+
`);
711+
712+
const tree = await schematicRunner
713+
.runSchematicAsync(migrationName, {}, appTree)
714+
.toPromise();
715+
716+
expect(
717+
tree.readContent('/testSrc/appPrefix/component/test.component.ts')
718+
).toEqual(
719+
`
720+
import { IComboSelectionChangingEventArgs } from 'igniteui-angular';
721+
export class MyClass {
722+
public eventArgs: IComboSelectionChangingEventArgs;
723+
}
724+
`
725+
);
726+
});
727+
728+
it('Should properly rename AutocompleteItemSelectionEventArgs to AutocompleteSelectionChangingEventArgs', async () => {
729+
appTree.create('/testSrc/appPrefix/component/test.component.ts',
730+
`
731+
import { AutocompleteItemSelectionEventArgs } from 'igniteui-angular';
732+
export class MyClass {
733+
public eventArgs: AutocompleteItemSelectionEventArgs;
734+
}
735+
`);
736+
737+
const tree = await schematicRunner
738+
.runSchematicAsync(migrationName, {}, appTree)
739+
.toPromise();
740+
741+
expect(
742+
tree.readContent('/testSrc/appPrefix/component/test.component.ts')
743+
).toEqual(
744+
`
745+
import { AutocompleteSelectionChangingEventArgs } from 'igniteui-angular';
746+
export class MyClass {
747+
public eventArgs: AutocompleteSelectionChangingEventArgs;
748+
}
749+
`
750+
);
751+
});
702752
});
703753

704754

0 commit comments

Comments
 (0)