From b90e916449c9af1f04aa26a344589bbdda287cb4 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 20 Nov 2026 16:03:41 +0200 Subject: [PATCH 1/2] test(*): cover paths the vitest migration left untested Co-Authored-By: Claude Opus 5.5 --- .../date-range-picker.component.spec.ts | 63 +++++++++++- .../directives/drag-drop/drag-drop.spec.ts | 65 ++++++++++++ .../grids/grid/src/column-moving.spec.ts | 18 ++-- ...rid-excel-style-filtering-features.spec.ts | 28 ++++++ .../grid/src/grid-filtering-advanced.spec.ts | 33 ++++++- .../grids/pivot-grid/src/pivot-grid.spec.ts | 26 +++++ .../tree-grid/src/tree-grid-selection.spec.ts | 6 +- .../igniteui-angular/src/public_api.spec.ts | 99 +++++++++++++++++++ 8 files changed, 328 insertions(+), 10 deletions(-) create mode 100644 projects/igniteui-angular/src/public_api.spec.ts diff --git a/projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts b/projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts index f4e150083f3..5232b6afde9 100644 --- a/projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts +++ b/projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts @@ -57,12 +57,12 @@ describe('IgxDateRangePicker', () => { const elementRef = { nativeElement: null }; let onChangeFn: ReturnType; - let _onTouchedFn: ReturnType; + let onTouchedFn: ReturnType; let onValidatorChangeFn: ReturnType; beforeEach(async () => { onChangeFn = vi.fn().mockName('NgControl.onChange'); - _onTouchedFn = vi.fn().mockName('NgControl.onTouched'); + onTouchedFn = vi.fn().mockName('NgControl.onTouched'); onValidatorChangeFn = vi.fn().mockName('NgControl.onValidatorChange'); await TestBed.configureTestingModule({ @@ -162,6 +162,16 @@ describe('IgxDateRangePicker', () => { dateRange.setDisabledState(false); expect(dateRange.disabled).toBe(false); }); + + it('calls the onTouched callback on input blur and leaves the validity state untouched when no form control is bound', () => { + dateRange.registerOnTouched(onTouchedFn); + const input = fixture.debugElement.query(By.css(CSS_CLASS_INPUT)); + + input.nativeElement.dispatchEvent(new FocusEvent('blur')); + + expect(onTouchedFn).toHaveBeenCalledTimes(1); + expect(dateRange.inputDirective.valid).toBe(IgxInputState.INITIAL); + }); }); describe('clear()', () => { @@ -997,6 +1007,21 @@ describe('IgxDateRangePicker', () => { detectChanges(); }); + it('should clear the calendar selection when the value is cleared while it\'s open', async () => { + dateRange.value = { start: new Date(2025, 1, 3), end: new Date(2025, 1, 5) }; + dateRange.open(); + await vi.runAllTimersAsync(); + detectChanges(); + + const rangeCalendar = (dateRange as any).calendar; + expect(rangeCalendar.selectedDates.length).toBeGreaterThan(0); + + dateRange.value = null; + detectChanges(); + + expect(rangeCalendar.selectedDates).toEqual([]); + }); + it('should set initial validity state when the form group is disabled', () => { const fix = TestBed.createComponent(DateRangeReactiveFormComponent); fix.detectChanges(); @@ -2227,6 +2252,40 @@ describe('IgxDateRangePicker', () => { expect(dateRange['_calendar'].disabledDates).toEqual(disabledDates); }); + it('should disable calendar dates when min and/or max values as dates are provided', async () => { + fixture = TestBed.createComponent(DateRangeDefaultComponent); + fixture.componentInstance.minValue = new Date(2000, 10, 1); + fixture.componentInstance.maxValue = new Date(2000, 10, 20); + fixture.detectChanges(); + dateRange = fixture.componentInstance.dateRange; + + dateRange.open(); + await vi.runAllTimersAsync(); + fixture.detectChanges(); + + expect(dateRange['_calendar'].disabledDates).toEqual([ + { type: DateRangeType.Before, dateRange: [new Date(2000, 10, 1)] }, + { type: DateRangeType.After, dateRange: [new Date(2000, 10, 20)] } + ]); + }); + + it('should disable calendar dates when min and/or max values as strings are provided', async () => { + fixture = TestBed.createComponent(DateRangeDefaultComponent); + fixture.componentInstance.minValue = '2000-10-01T00:00:00'; + fixture.componentInstance.maxValue = '2000-10-30T00:00:00'; + fixture.detectChanges(); + dateRange = fixture.componentInstance.dateRange; + + dateRange.open(); + await vi.runAllTimersAsync(); + fixture.detectChanges(); + + expect(dateRange['_calendar'].disabledDates).toEqual([ + { type: DateRangeType.Before, dateRange: [new Date(2000, 9, 1)] }, + { type: DateRangeType.After, dateRange: [new Date(2000, 9, 30)] } + ]); + }); + it('should initialize activeDate with current date, when not set', async () => { fixture = TestBed.createComponent(DateRangeDefaultComponent); fixture.detectChanges(); diff --git a/projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.spec.ts b/projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.spec.ts index 73fb97c3193..cd09b4e0a48 100644 --- a/projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.spec.ts +++ b/projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.spec.ts @@ -3167,6 +3167,71 @@ describe('igxDrag touch, mouse, pointerLost and shadow root coverage', () => { }); }) +describe('igxDrag window auto-scroll', () => { + let fix: ComponentFixture; + let spacer: HTMLElement; + const extraScrollHeight = 100; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TestDragDropComponent] + }).compileComponents(); + }); + + beforeEach(() => { + // Makes the document a fixed amount taller than the viewport so the window can scroll. + spacer = document.createElement('div'); + spacer.style.cssText = `position: absolute; top: 0; left: 0; width: 1px; height: ${window.innerHeight + extraScrollHeight}px;`; + document.body.appendChild(spacer); + window.scrollTo(0, 0); + + fix = TestBed.createComponent(TestDragDropComponent); + fix.detectChanges(); + }); + + afterEach(() => { + spacer.remove(); + window.scrollTo(0, 0); + }); + + /** Starts dragging `drag` and moves its ghost within the scroll threshold of the viewport bottom. */ + const dragToViewportBottom = async (drag: IgxDragDirective) => { + const element = drag.element.nativeElement; + const rect = getElemRects(element); + const startingX = (rect.left + rect.right) / 2; + const startingY = (rect.top + rect.bottom) / 2; + + UIInteractions.simulatePointerEvent('pointerdown', element, startingX, startingY); + await nextFrame(); + UIInteractions.simulatePointerEvent('pointermove', element, startingX, window.innerHeight - 10); + expect(drag.ghostElement).toBeTruthy(); + }; + + it('should stop scrolling the window when destroyed while auto-scrolling', async () => { + const firstDrag = fix.componentInstance.dragElems.first; + await dragToViewportBottom(firstDrag); + await vi.waitFor(() => expect(window.scrollY).toBeGreaterThan(0)); + + // Each scroll step is queued for the next animation frame. Destroying right after one is queued + // runs that step without a ghost, which must not throw. + const step = (firstDrag as any).onScrollContainerStep.bind(firstDrag); + const stepQueued = new Promise(resolve => { + vi.spyOn(firstDrag as any, 'onScrollContainerStep').mockImplementationOnce((direction) => { + step(direction); + resolve(); + }); + }); + await stepQueued; + fix.destroy(); + expect(firstDrag.ghostElement).toBeNull(); + + await nextFrame(); + const scrollY = window.scrollY; + await wait(100); + expect(window.scrollY).toBe(scrollY); + }); +}) + const getDragDirsRects = (dragDirs: QueryList) => { const dragDirsRects = []; dragDirs.forEach((dragDir) => { diff --git a/projects/igniteui-angular/grids/grid/src/column-moving.spec.ts b/projects/igniteui-angular/grids/grid/src/column-moving.spec.ts index 8d42892508b..2b3cc7bd100 100644 --- a/projects/igniteui-angular/grids/grid/src/column-moving.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/column-moving.spec.ts @@ -26,6 +26,7 @@ describe('IgxGrid - Column Moving #grid', () => { const COLUMN_HEADER_CLASS = '.igx-grid-th'; const COLUMN_GROUP_HEADER_CLASS = '.igx-grid-thead__title'; const COLUMN_RESIZE_CLASS = '.igx-grid-th__resize-line'; + const GHOST_CLASS = 'igx-grid__drag-ghost-image'; let fixture; let grid: IgxGridComponent; @@ -425,11 +426,14 @@ describe('IgxGrid - Column Moving #grid', () => { await nextFrame(); UIInteractions.simulatePointerEvent('pointermove', header, 270, 71); await wait(); + expect(document.querySelector(`.${GHOST_CLASS}`)).not.toBeNull(); // step 2 - hit ESCAPE over the headers area and verify column moving is canceled - document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); - document.dispatchEvent(new KeyboardEvent('keyup', { key: 'Escape' })); + // The moving directive listens for keydown on the window. + document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true })); + document.dispatchEvent(new KeyboardEvent('keyup', { key: 'Escape', bubbles: true })); fixture.detectChanges(); + expect(document.querySelector(`.${GHOST_CLASS}`), 'ESCAPE should end the drag').toBeNull(); UIInteractions.simulatePointerEvent('pointerup', header, 270, 71); await wait(); @@ -690,14 +694,16 @@ describe('IgxGrid - Column Moving #grid', () => { await wait(); UIInteractions.simulatePointerEvent('pointermove', header, 156, 71); - await wait(); + // The drag directive drops pointer moves within the same animation frame. + await nextFrame(); - if (fixture.componentInstance.source.field === 'ID') { - fixture.componentInstance.cancel = true; - } + expect(fixture.componentInstance.source.field).toBe('ID'); + expect(document.querySelector(`.${GHOST_CLASS}`)).not.toBeNull(); + fixture.componentInstance.cancel = true; UIInteractions.simulatePointerEvent('pointermove', header, 330, 75); await nextFrame(); + expect(document.querySelector(`.${GHOST_CLASS}`), 'canceling columnMoving should end the drag').toBeNull(); UIInteractions.simulatePointerEvent('pointerup', header, 330, 75); await wait(); fixture.detectChanges(); diff --git a/projects/igniteui-angular/grids/grid/src/grid-excel-style-filtering-features.spec.ts b/projects/igniteui-angular/grids/grid/src/grid-excel-style-filtering-features.spec.ts index ae1055a9d59..4e3ec01f0b0 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-excel-style-filtering-features.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-excel-style-filtering-features.spec.ts @@ -1596,6 +1596,34 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => { expect(console.error).not.toHaveBeenCalled(); }); + + it('Should show the templated ESF again when reopened after the custom dialog was cancelled.', async () => { + const esfComponent = grid.excelStyleFilteringComponent; + const esf: HTMLElement = esfComponent.element.nativeElement; + await GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads'); + expect(esf.isConnected).toBe(true); + const originalDisplay = getComputedStyle(esf).display; + expect(originalDisplay).not.toBe('none'); + + GridFunctions.clickExcelFilterCascadeButton(fix); + fix.detectChanges(); + GridFunctions.clickOperatorFromCascadeMenu(fix, 0); + await fix.whenStable(); + fix.detectChanges(); + expect(GridFunctions.getExcelStyleCustomFilteringDialog(fix)).not.toBeNull(); + expect(getComputedStyle(esf).display).toBe('none'); + + GridFunctions.clickCancelExcelStyleCustomFiltering(fix); + await fix.whenStable(); + fix.detectChanges(); + + // The ESF declared in the grid template is one instance reused for every opening, so it stays hidden + // unless reopening undoes the hiding done for the dialog. + await GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName'); + expect(esfComponent.column.field).toBe('ProductName'); + expect(esf.isConnected).toBe(true); + expect(getComputedStyle(esf).display).toBe(originalDisplay); + }); }); }); diff --git a/projects/igniteui-angular/grids/grid/src/grid-filtering-advanced.spec.ts b/projects/igniteui-angular/grids/grid/src/grid-filtering-advanced.spec.ts index c3e8fa08205..8275704e9a7 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-filtering-advanced.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-filtering-advanced.spec.ts @@ -10,7 +10,7 @@ import { SampleTestData } from '../../../test-utils/sample-test-data.spec'; import { By } from '@angular/platform-browser'; import { QueryBuilderFunctions } from '../../../query-builder/src/query-builder/query-builder-functions.spec'; import { IFilteringEventArgs, IgxGridNavigationService, IgxGridToolbarAdvancedFilteringComponent } from 'igniteui-angular/grids/core'; -import { FilteringExpressionsTree, FilteringLogic, FormattedValuesFilteringStrategy, IGridResourceStrings, IgxNumberFilteringOperand, IgxStringFilteringOperand } from 'igniteui-angular/core'; +import { changei18n, FilteringExpressionsTree, FilteringLogic, FormattedValuesFilteringStrategy, GridResourceStringsEN, IGridResourceStrings, IgxNumberFilteringOperand, IgxStringFilteringOperand } from 'igniteui-angular/core'; import { QueryBuilderSelectors } from 'igniteui-angular/query-builder/src/query-builder/query-builder.common'; import { IgxDateTimeEditorDirective } from 'igniteui-angular/directives'; import { IGridCreatedEventArgs, IgxHierarchicalGridComponent, IgxRowIslandComponent } from 'igniteui-angular/grids/hierarchical-grid'; @@ -1381,6 +1381,37 @@ describe('IgxGrid - Advanced Filtering #grid - ', () => { expect(addingButtons[0].innerText).toBe('add\nMy condition'); expect(addingButtons[1].innerText).toBe('add\nMy group'); }); + + it('Should update the opened Advanced Filtering dialog when the resource strings change globally.', async () => { + const fix = TestBed.createComponent(IgxGridAdvancedFilteringComponent); + const grid: IgxGridComponent = fix.componentInstance.grid; + const tree = new FilteringExpressionsTree(FilteringLogic.And); + tree.filteringOperands.push({ + fieldName: 'ProductName', + condition: IgxStringFilteringOperand.instance().condition('contains'), + searchVal: 'angular', + ignoreCase: true + }); + grid.advancedFilteringExpressionsTree = tree; + fix.detectChanges(); + + grid.openAdvancedFilteringDialog(); + fix.detectChanges(); + const getAddConditionButtonText = () => + (QueryBuilderFunctions.getQueryBuilderTreeRootGroupButtons(fix, 0)[0] as HTMLElement).querySelector('span').innerText; + expect(getAddConditionButtonText()).toBe('Condition'); + + try { + // The dialog passes the grid's advanced filtering strings to the query builder as custom strings, + // which the query builder does not refresh by itself. + changei18n({ igx_grid_advanced_filter_add_condition_root: 'Bedingung' }); + fix.detectChanges(); + + expect(getAddConditionButtonText()).toBe('Bedingung'); + } finally { + changei18n(GridResourceStringsEN); + } + }); }); describe('Column groups - ', () => { diff --git a/projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.spec.ts b/projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.spec.ts index 1b1495e3262..6a237d39322 100644 --- a/projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.spec.ts +++ b/projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.spec.ts @@ -3,10 +3,12 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { + changei18n, ColumnPinningPosition, FilteringExpressionsTree, FilteringLogic, GridColumnDataType, + GridResourceStringsEN, GridSummaryCalculationMode, IDataCloneStrategy, IgxStringFilteringOperand, @@ -2604,6 +2606,30 @@ describe('IgxPivotGrid #pivotGrid', () => { expect(dateDimension.resourceStrings.igx_grid_pivot_date_dimension_total).toBe('Custom total'); }); + it('should regenerate the date dimension columns when the resource strings change globally.', async () => { + const pivotGrid = fixture.componentInstance.pivotGrid; + // The grid subscribes to resource changes only after its initial columns are generated. + await fixture.whenStable(); + pivotGrid.pivotConfiguration = { + columns: [new IgxPivotDateDimension({ memberName: 'Date', enabled: true }, { years: false, months: false, fullDate: false })], + rows: [{ memberName: 'SellerName', enabled: true }], + values: [fixture.componentInstance.pivotConfigHierarchy.values[0]] + }; + fixture.detectChanges(); + expect(pivotGrid.columns.map(x => x.header)).toEqual(['All Periods']); + + try { + changei18n({ igx_grid_pivot_date_dimension_total: 'Alle Perioden' }); + // The columns are regenerated asynchronously after the resource change. + await vi.waitFor(() => expect(pivotGrid.columns.map(x => x.header)).toEqual(['Alle Perioden'])); + fixture.detectChanges(); + + expect(GridFunctions.getColumnHeaderTitleByIndex(fixture, 0).innerText).toBe('Alle Perioden'); + } finally { + changei18n(GridResourceStringsEN); + } + }); + it('should sort row dimensions with date values.', () => { const pivotGrid = fixture.componentInstance.pivotGrid; pivotGrid.pivotConfiguration.rows = [{ diff --git a/projects/igniteui-angular/grids/tree-grid/src/tree-grid-selection.spec.ts b/projects/igniteui-angular/grids/tree-grid/src/tree-grid-selection.spec.ts index e4ea78861b9..3669909893e 100644 --- a/projects/igniteui-angular/grids/tree-grid/src/tree-grid-selection.spec.ts +++ b/projects/igniteui-angular/grids/tree-grid/src/tree-grid-selection.spec.ts @@ -1471,9 +1471,13 @@ describe('IgxTreeGrid - Selection #tGrid', () => { searchVal: 299 } ]; + const filtered = filteringDone(treeGrid); treeGrid.filter('ID', null, expressionTree); + // Let the pipes filter the rows before filteringDone fires, as change detection does in an app; + // otherwise 317 still has visible children when its cascade state is updated. + fix.detectChanges(); - await nextFrame(); + await filtered; fix.detectChanges(); expect(getVisibleSelectedRows(fix).length).toBe(1); diff --git a/projects/igniteui-angular/src/public_api.spec.ts b/projects/igniteui-angular/src/public_api.spec.ts new file mode 100644 index 00000000000..d820c7f6c3d --- /dev/null +++ b/projects/igniteui-angular/src/public_api.spec.ts @@ -0,0 +1,99 @@ +import { isStandalone, Type } from '@angular/core'; +import { IGX_ACCORDION_DIRECTIVES } from 'igniteui-angular/accordion'; +import { IGX_ACTION_STRIP_DIRECTIVES } from 'igniteui-angular/action-strip'; +import { IGX_BANNER_DIRECTIVES } from 'igniteui-angular/banner'; +import { IGX_BOTTOM_NAV_DIRECTIVES } from 'igniteui-angular/bottom-nav'; +import { IGX_BUTTON_GROUP_DIRECTIVES } from 'igniteui-angular/button-group'; +import { IGX_CALENDAR_DIRECTIVES } from 'igniteui-angular/calendar'; +import { IGX_CARD_DIRECTIVES } from 'igniteui-angular/card'; +import { IGX_CAROUSEL_DIRECTIVES } from 'igniteui-angular/carousel'; +import { IGX_CHIPS_DIRECTIVES } from 'igniteui-angular/chips'; +import { IGX_COMBO_DIRECTIVES } from 'igniteui-angular/combo'; +import { IGX_DATE_PICKER_DIRECTIVES, IGX_DATE_RANGE_PICKER_DIRECTIVES } from 'igniteui-angular/date-picker'; +import { IGX_DIALOG_DIRECTIVES } from 'igniteui-angular/dialog'; +import { IGX_DRAG_DROP_DIRECTIVES, IGX_TOOLTIP_DIRECTIVES } from 'igniteui-angular/directives'; +import { IGX_DROP_DOWN_DIRECTIVES } from 'igniteui-angular/drop-down'; +import { IGX_EXPANSION_PANEL_DIRECTIVES } from 'igniteui-angular/expansion-panel'; +import { IGX_GRID_COMMON_DIRECTIVES, IGX_GRID_VALIDATION_DIRECTIVES } from 'igniteui-angular/grids/core'; +import { IGX_GRID_DIRECTIVES } from 'igniteui-angular/grids/grid'; +import { IGX_HIERARCHICAL_GRID_DIRECTIVES } from 'igniteui-angular/grids/hierarchical-grid'; +import { IGX_PIVOT_GRID_DIRECTIVES } from 'igniteui-angular/grids/pivot-grid'; +import { IGX_TREE_GRID_DIRECTIVES } from 'igniteui-angular/grids/tree-grid'; +import { IGX_INPUT_GROUP_DIRECTIVES } from 'igniteui-angular/input-group'; +import { IGX_LIST_DIRECTIVES } from 'igniteui-angular/list'; +import { IGX_NAVBAR_DIRECTIVES } from 'igniteui-angular/navbar'; +import { IGX_NAVIGATION_DRAWER_DIRECTIVES } from 'igniteui-angular/navigation-drawer'; +import { IGX_PAGINATOR_DIRECTIVES } from 'igniteui-angular/paginator'; +import { + IGX_CIRCULAR_PROGRESS_BAR_DIRECTIVES, + IGX_LINEAR_PROGRESS_BAR_DIRECTIVES, + IGX_PROGRESS_BAR_DIRECTIVES +} from 'igniteui-angular/progressbar'; +import { IGX_QUERY_BUILDER_DIRECTIVES } from 'igniteui-angular/query-builder'; +import { IGX_RADIO_GROUP_DIRECTIVES } from 'igniteui-angular/radio'; +import { IGX_SELECT_DIRECTIVES } from 'igniteui-angular/select'; +import { IGX_SIMPLE_COMBO_DIRECTIVES } from 'igniteui-angular/simple-combo'; +import { IGX_SLIDER_DIRECTIVES } from 'igniteui-angular/slider'; +import { IGX_SPLITTER_DIRECTIVES } from 'igniteui-angular/splitter'; +import { IGX_STEPPER_DIRECTIVES } from 'igniteui-angular/stepper'; +import { IGX_TABS_DIRECTIVES } from 'igniteui-angular/tabs'; +import { IGX_TIME_PICKER_DIRECTIVES } from 'igniteui-angular/time-picker'; +import { IGX_TREE_DIRECTIVES } from 'igniteui-angular/tree'; +import { describe, it, expect } from 'vitest'; + +const collections: Record[]> = { + IGX_ACCORDION_DIRECTIVES, + IGX_ACTION_STRIP_DIRECTIVES, + IGX_BANNER_DIRECTIVES, + IGX_BOTTOM_NAV_DIRECTIVES, + IGX_BUTTON_GROUP_DIRECTIVES, + IGX_CALENDAR_DIRECTIVES, + IGX_CARD_DIRECTIVES, + IGX_CAROUSEL_DIRECTIVES, + IGX_CHIPS_DIRECTIVES, + IGX_CIRCULAR_PROGRESS_BAR_DIRECTIVES, + IGX_COMBO_DIRECTIVES, + IGX_DATE_PICKER_DIRECTIVES, + IGX_DATE_RANGE_PICKER_DIRECTIVES, + IGX_DIALOG_DIRECTIVES, + IGX_DRAG_DROP_DIRECTIVES, + IGX_DROP_DOWN_DIRECTIVES, + IGX_EXPANSION_PANEL_DIRECTIVES, + IGX_GRID_COMMON_DIRECTIVES, + IGX_GRID_DIRECTIVES, + IGX_GRID_VALIDATION_DIRECTIVES, + IGX_HIERARCHICAL_GRID_DIRECTIVES, + IGX_INPUT_GROUP_DIRECTIVES, + IGX_LINEAR_PROGRESS_BAR_DIRECTIVES, + IGX_LIST_DIRECTIVES, + IGX_NAVBAR_DIRECTIVES, + IGX_NAVIGATION_DRAWER_DIRECTIVES, + IGX_PAGINATOR_DIRECTIVES, + IGX_PIVOT_GRID_DIRECTIVES, + IGX_PROGRESS_BAR_DIRECTIVES, + IGX_QUERY_BUILDER_DIRECTIVES, + IGX_RADIO_GROUP_DIRECTIVES, + IGX_SELECT_DIRECTIVES, + IGX_SIMPLE_COMBO_DIRECTIVES, + IGX_SLIDER_DIRECTIVES, + IGX_SPLITTER_DIRECTIVES, + IGX_STEPPER_DIRECTIVES, + IGX_TABS_DIRECTIVES, + IGX_TIME_PICKER_DIRECTIVES, + IGX_TOOLTIP_DIRECTIVES, + IGX_TREE_DIRECTIVES, + IGX_TREE_GRID_DIRECTIVES +}; + +describe('Entry point directive collections', () => { + // Consumers spread these into `imports`. A circular import between entry points leaves an + // entry `undefined` at evaluation time, which fails the consumer's component compilation. + it.each(Object.entries(collections))('%s should contain only defined standalone types', (_name, collection) => { + expect(collection.length).toBeGreaterThan(0); + const names = collection.map(type => type?.name); + collection.forEach((type, index) => { + expect(type, `entry ${index} of [${names.join(', ')}]`).toBeDefined(); + expect(isStandalone(type), `${type.name} is not standalone`).toBe(true); + }); + }); +}); From c3f93c4ac82a45bb79fb6fdb3970d279d41b6fa1 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 20 Nov 2026 19:32:04 +0200 Subject: [PATCH 2/2] refactor(grid): drop the autosize per-row refresh that no longer runs Since #17790, autoSizeColumnsInView refreshes the whole grid before measuring, so a column no longer has fewer cells than there are rows and the per-row refresh after it never runs. Co-Authored-By: Claude Opus 5.5 --- .../igniteui-angular/grids/grid/src/grid-base.directive.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts b/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts index f9bc5fad1b2..fbe00fb1e6f 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts @@ -7732,9 +7732,6 @@ export abstract class IgxGridBaseDirective implements GridType, for (const col of columnsInView) { if (!col.autoSize && col.headerCell) { const cellsContentWidths: number[] = []; - if (col._cells.length !== this.rowList.length) { - this.rowList.forEach(x => x.cdr.detectChanges()); - } const cells = this._dataRowList.map(x => x.cells.find(c => c.column === col)); cells.forEach((cell) => cellsContentWidths.push(cell?.nativeElement?.offsetWidth || 0)); let maxForCells = Math.max(...cellsContentWidths);