|
8 | 8 | IgxTreeGridStringTreeColumnComponent, IgxTreeGridDateTreeColumnComponent, IgxTreeGridBooleanTreeColumnComponent,
|
9 | 9 | IgxTreeGridRowEditingComponent, IgxTreeGridMultiColHeadersComponent,
|
10 | 10 | IgxTreeGridRowEditingTransactionComponent,
|
11 |
| - IgxTreeGridRowEditingHierarchicalDSTransactionComponent |
| 11 | + IgxTreeGridRowEditingHierarchicalDSTransactionComponent, |
| 12 | + IgxTreeGridRowPinningComponent |
12 | 13 | } from '../../test-utils/tree-grid-components.spec';
|
13 | 14 | import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
14 | 15 | import { TreeGridFunctions } from '../../test-utils/tree-grid-functions.spec';
|
@@ -38,6 +39,7 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
|
38 | 39 | IgxTreeGridDateTreeColumnComponent,
|
39 | 40 | IgxTreeGridBooleanTreeColumnComponent,
|
40 | 41 | IgxTreeGridRowEditingComponent,
|
| 42 | + IgxTreeGridRowPinningComponent, |
41 | 43 | IgxTreeGridMultiColHeadersComponent,
|
42 | 44 | IgxTreeGridRowEditingTransactionComponent,
|
43 | 45 | IgxTreeGridRowEditingHierarchicalDSTransactionComponent
|
@@ -1374,4 +1376,35 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
|
1374 | 1376 | expect(leftMostRightPinnedCellsPart + Number.parseInt(pinnedCellWidth, 10) <= rightMostGridPart).toBeTruthy();
|
1375 | 1377 | });
|
1376 | 1378 | });
|
| 1379 | + |
| 1380 | + describe('Row Pinning', () => { |
| 1381 | + it('should pin/unpin a row', () => { |
| 1382 | + fix = TestBed.createComponent(IgxTreeGridRowPinningComponent); |
| 1383 | + fix.detectChanges(); |
| 1384 | + |
| 1385 | + treeGrid = fix.componentInstance.treeGrid as IgxTreeGridComponent; |
| 1386 | + treeGrid.pinRow(711); |
| 1387 | + treeGrid.cdr.detectChanges(); |
| 1388 | + |
| 1389 | + expect(treeGrid.pinnedRecordsCount).toBe(1); |
| 1390 | + expect(treeGrid.getRowByKey(711).pinned).toBe(true); |
| 1391 | + |
| 1392 | + treeGrid.unpinRow(711); |
| 1393 | + treeGrid.cdr.detectChanges(); |
| 1394 | + expect(treeGrid.pinnedRecordsCount).toBe(0); |
| 1395 | + expect(treeGrid.getRowByKey(711).pinned).toBe(false); |
| 1396 | + |
| 1397 | + treeGrid.getRowByKey(711).pin(); |
| 1398 | + treeGrid.cdr.detectChanges(); |
| 1399 | + expect(treeGrid.pinnedRecordsCount).toBe(1); |
| 1400 | + |
| 1401 | + treeGrid.getRowByKey(711).unpin(); |
| 1402 | + treeGrid.cdr.detectChanges(); |
| 1403 | + expect(treeGrid.pinnedRecordsCount).toBe(0); |
| 1404 | + }); |
| 1405 | + it('should pin/unpin a row at the bottom', () => {}); |
| 1406 | + it('should calculate row indices correctly after row pinning', () => {}); |
| 1407 | + it('should disable pinned row instance in the body', () => {}); |
| 1408 | + it('should add pinned badge in the pinned row instance in the body', () => {}); |
| 1409 | + }); |
1377 | 1410 | });
|
0 commit comments