Skip to content

Commit c5ee949

Browse files
committed
chore(igx-grid): add schematics test
1 parent ab8de76 commit c5ee949

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ All notable changes for each version of this project will be documented in this
3636
- `onToolbarExporting` -> `toolbarExporting`
3737
- `onRangeSelection` -> `rangeSelected`
3838
- `IgxGridRowComponent`, `IgxGridGroupByRowComponent`, `IgxTreeGridRowComponent`, `IgxHierarchicalRowComponent` are no longer exposed in the public API. Automatic migration will change these imports with `RowType`.
39+
- The IgxColumn data type `DataType` is renamed to `GridColumnDataType`.
3940
- **Behavioral changes**
4041
- `getRowByIndex`, `getRowByKey`, `cell.row` now return an object implemening the `RowType` interface.
4142
- `dragData` emitted with `IRowDragEndEventArgs`, `IRowDragStartEventArgs` is now `RowType`

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,4 +1574,44 @@ export class HGridMultiRowDragComponent {
15741574
}
15751575
}`);
15761576
});
1577+
1578+
it('should rename DataType to GridColumnDataType', async () => {
1579+
appTree.create(
1580+
'/testSrc/appPrefix/component/test.component.ts',
1581+
`import { Component, ViewChild } from '@angular/core';
1582+
import { IgxColumnComponent, DataType } from 'igniteui-angular';
1583+
1584+
@Component({
1585+
selector: 'column-dataType',
1586+
templateUrl: './test.component.html',
1587+
styleUrls: ['./test.component.scss']
1588+
})
1589+
export class ColumnDataType {
1590+
public dataType: DataType = DataType.Boolean;
1591+
}
1592+
`);
1593+
1594+
const tree = await schematicRunner
1595+
.runSchematicAsync(migrationName, {}, appTree)
1596+
.toPromise();
1597+
1598+
const expectedContent = `import { Component, ViewChild } from '@angular/core';
1599+
import { IgxColumnComponent, GridColumnDataType } from 'igniteui-angular';
1600+
1601+
@Component({
1602+
selector: 'column-dataType',
1603+
templateUrl: './test.component.html',
1604+
styleUrls: ['./test.component.scss']
1605+
})
1606+
export class ColumnDataType {
1607+
public dataType: GridColumnDataType = GridColumnDataType.Boolean;
1608+
}
1609+
`;
1610+
1611+
expect(
1612+
tree.readContent(
1613+
'/testSrc/appPrefix/component/test.component.ts'
1614+
)
1615+
).toEqual(expectedContent);
1616+
});
15771617
});

0 commit comments

Comments
 (0)