Skip to content

Commit 5ccc2d1

Browse files
committed
test(migrations): check enum names and igx-tabs input migrations
1 parent e2b86bf commit 5ccc2d1

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

projects/igniteui-angular/migrations/update-9_0_0/changes/classes.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828
{
2929
"name": "IgxBaseExporter",
3030
"replaceWith": "IgxBaseExporterDirective"
31+
},
32+
{
33+
"name": "AvatarType",
34+
"replaceWith": "IgxAvatarType"
35+
},
36+
{
37+
"name": "Size",
38+
"replaceWith": "IgxAvatarSize"
39+
},
40+
{
41+
"name": "Type",
42+
"replaceWith": "IgxBadgeType"
43+
},
44+
{
45+
"name": "SliderType",
46+
"replaceWith": "IgxSliderType"
3147
}
3248
]
3349
}

projects/igniteui-angular/migrations/update-9_0_0/changes/inputs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"selector": "igx-slider",
99
"type": "component"
1010
}
11+
},
12+
{
13+
"name": "tabsType",
14+
"replaceWith": "type",
15+
"owner": {
16+
"selector": "igx-tabs",
17+
"type": "component"
18+
}
1119
}
1220
]
1321
}

projects/igniteui-angular/migrations/update-9_0_0/index.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,32 @@ describe('Update 9.0.0', () => {
4343
`);
4444
done();
4545
});
46+
47+
it('should update Enum names.', done => {
48+
appTree.create(
49+
'/testSrc/appPrefix/component/enum.component.ts',
50+
`import { AvatarType, Size, Type, SliderType } from 'igniteui-angular';
51+
`);
52+
53+
const tree = schematicRunner.runSchematic('migration-13', {}, appTree);
54+
expect(tree.readContent('/testSrc/appPrefix/component/enum.component.ts'))
55+
.toEqual(
56+
`import { IgxAvatarType, IgxAvatarSize, IgxBadgeType, IgxSliderType } from 'igniteui-angular';
57+
`);
58+
done();
59+
});
60+
61+
it('should update input prop from tabsType to type', done => {
62+
appTree.create(
63+
'/testSrc/appPrefix/component/tabs.component.html',
64+
'<igx-tabs tabsType="fixed"></igx-tabs>'
65+
);
66+
67+
const tree = schematicRunner.runSchematic('migration-13', {}, appTree);
68+
69+
expect(tree.readContent('/testSrc/appPrefix/component/tabs.component.html'))
70+
.toEqual('<igx-tabs type="fixed"></igx-tabs>');
71+
72+
done();
73+
});
4674
});

0 commit comments

Comments
 (0)