Skip to content

Commit db09bcd

Browse files
committed
chore(grid): add migration tests
1 parent 80f61cd commit db09bcd

File tree

1 file changed

+55
-2
lines changed

1 file changed

+55
-2
lines changed

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

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,60 @@ describe(`Update to ${version}`, () => {
2828
});
2929

3030
const migrationName = 'migration-23';
31-
const lineBreaksAndSpaceRegex = /\s/g;
3231

33-
32+
it('should remove columns` movable prop and enable grid`s moving prop if there is movable columns', async () => {
33+
appTree.create(
34+
`/testSrc/appPrefix/component/test.component.html`,
35+
`
36+
<igx-grid>
37+
<igx-column [movable]="true"></igx-column>
38+
<igx-column></igx-column>
39+
</igx-grid>
40+
`
41+
);
42+
43+
const tree = await schematicRunner
44+
.runSchematicAsync(migrationName, {}, appTree)
45+
.toPromise();
46+
47+
expect(
48+
tree.readContent('/testSrc/appPrefix/component/test.component.html')
49+
).toEqual(
50+
`
51+
<igx-grid [moving]="true">
52+
<igx-column ></igx-column>
53+
<igx-column></igx-column>
54+
</igx-grid>
55+
`
56+
);
57+
});
58+
59+
it('should remove columns` movable prop and don`t set the grid`s moving prop if there isn`t movable columns', async () => {
60+
appTree.create(
61+
`/testSrc/appPrefix/component/test.component.html`,
62+
`
63+
<igx-grid>
64+
<igx-column [movable]="false"></igx-column>
65+
<igx-column></igx-column>
66+
</igx-grid>
67+
`
68+
);
69+
70+
const tree = await schematicRunner
71+
.runSchematicAsync(migrationName, {}, appTree)
72+
.toPromise();
73+
74+
expect(
75+
tree.readContent('/testSrc/appPrefix/component/test.component.html')
76+
).toEqual(
77+
`
78+
<igx-grid>
79+
<igx-column ></igx-column>
80+
<igx-column></igx-column>
81+
</igx-grid>
82+
`
83+
);
84+
});
85+
86+
3487
});

0 commit comments

Comments
 (0)