diff --git a/projects/igniteui-angular/src/lib/data-operations/data-util.spec.ts b/projects/igniteui-angular/src/lib/data-operations/data-util.spec.ts index 27eb54186e2..e0a1603c3e5 100644 --- a/projects/igniteui-angular/src/lib/data-operations/data-util.spec.ts +++ b/projects/igniteui-angular/src/lib/data-operations/data-util.spec.ts @@ -487,9 +487,9 @@ const testMerging = () => { describe('Test merging', () => { it('Should merge add transactions correctly', () => { const data = SampleTestData.personIDNameData(); - const addRow4 = { ID: 4, Name: 'Peter' }; - const addRow5 = { ID: 5, Name: 'Mimi' }; - const addRow6 = { ID: 6, Name: 'Pedro' }; + const addRow4 = { ID: 4, IsEmployed: true, Name: 'Peter' }; + const addRow5 = { ID: 5, IsEmployed: true, Name: 'Mimi' }; + const addRow6 = { ID: 6, IsEmployed: false, Name: 'Pedro' }; const transactions: Transaction[] = [ { id: addRow4.ID, newValue: addRow4, type: TransactionType.ADD }, { id: addRow5.ID, newValue: addRow5, type: TransactionType.ADD }, diff --git a/projects/igniteui-angular/src/lib/grids/cell.component.html b/projects/igniteui-angular/src/lib/grids/cell.component.html index b195b27179f..c87188c2fd2 100644 --- a/projects/igniteui-angular/src/lib/grids/cell.component.html +++ b/projects/igniteui-angular/src/lib/grids/cell.component.html @@ -8,7 +8,7 @@ > -
{{ value ? "check" : "close" }} -
{ const grid = fix.componentInstance.grid; const formatter = fix.componentInstance.multiplier; + const boolFormatter = fix.componentInstance.boolFormatter; + expect(grid.columnList.first.formatter).toBeDefined(); for (let i = 0; i < 3; i++) { const cell = grid.gridAPI.get_cell_by_index(i, 'ID'); expect(cell.nativeElement.textContent).toMatch(formatter(cell.value)); + + const cellBool = grid.gridAPI.get_cell_by_index(i, 'IsEmployed'); + expect(cellBool.nativeElement.textContent).toMatch(boolFormatter(cellBool.value)); } }); @@ -161,18 +166,18 @@ describe('IgxGrid - Column properties #grid', () => { headers = fix.debugElement.queryAll(By.css(COLUMN_HEADER_CLASS)); expect(headers[0].nativeElement.textContent).toMatch('ID'); - expect(headers[1].nativeElement.textContent).toMatch('Name'); + expect(headers[2].nativeElement.textContent).toMatch('Name'); // Swap columns grid.moveColumn(grid.columnList.first, grid.columnList.last); fix.detectChanges(); - expect(grid.columnList.first.field).toMatch('Name'); + expect(grid.columnList.first.field).toMatch('IsEmployed'); expect(grid.columnList.last.field).toMatch('ID'); headers = fix.debugElement.queryAll(By.css(COLUMN_HEADER_CLASS)); - expect(headers[0].nativeElement.textContent).toMatch('Name'); - expect(headers[1].nativeElement.textContent).toMatch('ID'); + expect(headers[0].nativeElement.textContent).toMatch('IsEmployed'); + expect(headers[1].nativeElement.textContent).toMatch('Name'); }); it('should support adding and removing columns through a declared iterable', fakeAsync(/** columnList.changes rAF */() => { diff --git a/projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html b/projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html index 50f375aa31e..66afb57f36b 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html +++ b/projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html @@ -2,7 +2,8 @@ {{ grid.resourceStrings.igx_grid_pinned_row_indicator }} -
+ ? (value | percent:column.pipeArgs.digitsInfo:grid.locale) : value}}
+ + {{ value ? "check" : "close" }}
-
-
{{ value ? "check" : "close" }} -
([ - { ID: 1, Name: 'Johny' }, - { ID: 2, Name: 'Sally' }, - { ID: 3, Name: 'Tim' } + { ID: 1, IsEmployed: true, Name: 'Johny' }, + { ID: 2, IsEmployed: true, Name: 'Sally' }, + { ID: 3, IsEmployed: false, Name: 'Tim' }, ]); /* Data fields: FirstName: string, LastName: string, age:number; 3 items. */ diff --git a/projects/igniteui-angular/src/lib/test-utils/template-strings.spec.ts b/projects/igniteui-angular/src/lib/test-utils/template-strings.spec.ts index dbf14b53ee5..0af0edf9b6c 100644 --- a/projects/igniteui-angular/src/lib/test-utils/template-strings.spec.ts +++ b/projects/igniteui-angular/src/lib/test-utils/template-strings.spec.ts @@ -217,6 +217,7 @@ export class ColumnDefinitions { public static idNameFormatter = ` + `; diff --git a/src/app/grid-formatting/grid-formatting.component.html b/src/app/grid-formatting/grid-formatting.component.html index 57bfedd9bd8..210cff4c8a2 100644 --- a/src/app/grid-formatting/grid-formatting.component.html +++ b/src/app/grid-formatting/grid-formatting.component.html @@ -23,7 +23,7 @@

Grid with local data

- {{ cell.rowData.UnitsInStock }} + {{ getVal(cell) }}