|
1 | 1 | import { TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; |
2 | 2 | import { By } from '@angular/platform-browser'; |
3 | 3 | import { NoopAnimationsModule } from '@angular/platform-browser/animations'; |
4 | | -import { GridSelectionMode, IgxGridHeaderRowComponent, IgxGridMRLNavigationService, IPinningConfig } from 'igniteui-angular/grids/core'; |
| 4 | +import { GridSelectionMode, IgxGridHeaderRowComponent, IgxGridMRLNavigationService, IPinningConfig, RowPinningPosition } from 'igniteui-angular/grids/core'; |
5 | 5 | import { wait, UIInteractions } from '../../../test-utils/ui-interactions.spec'; |
6 | 6 | import { |
7 | 7 | CELL_PINNED_CLASS, |
@@ -1011,4 +1011,26 @@ describe('IgxGrid - Column Pinning #grid', () => { |
1011 | 1011 | expect(rootMRLGroups.map(x => x.visibleIndex)).toEqual([0, 2, 1]) |
1012 | 1012 | })); |
1013 | 1013 | }); |
| 1014 | + |
| 1015 | + describe('Pinning Configuration', () => { |
| 1016 | + let fix; |
| 1017 | + let grid: IgxGridComponent; |
| 1018 | + |
| 1019 | + beforeEach(() => { |
| 1020 | + fix = TestBed.createComponent(PinningComponent); |
| 1021 | + grid = fix.componentInstance.grid; |
| 1022 | + }); |
| 1023 | + |
| 1024 | + it('should merge partial user configuration with default values', () => { |
| 1025 | + // Default is { columns: ColumnPinningPosition.Start } |
| 1026 | + // Set only rows property |
| 1027 | + grid.pinning = { rows: RowPinningPosition.Bottom }; |
| 1028 | + fix.detectChanges(); |
| 1029 | + |
| 1030 | + // Should merge, keeping default columns value |
| 1031 | + expect(grid.pinning.columns).toBe(ColumnPinningPosition.Start); |
| 1032 | + expect(grid.pinning.rows).toBe(RowPinningPosition.Bottom); |
| 1033 | + }); |
| 1034 | + }); |
| 1035 | + |
1014 | 1036 | }); |
0 commit comments