From ee43fccd47cbe6895fd97baec6c7aab9ed7f375d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:12:22 +0000 Subject: [PATCH 1/2] Initial plan From d737327041294e043d80af426a5a5d46958f46a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:20:17 +0000 Subject: [PATCH 2/2] Add test for actionstrip outlet when added post-init Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com> --- .../grids/grid/src/grid-add-row.spec.ts | 36 +++++++++++++- .../test-utils/grid-samples.spec.ts | 48 +++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/projects/igniteui-angular/grids/grid/src/grid-add-row.spec.ts b/projects/igniteui-angular/grids/grid/src/grid-add-row.spec.ts index 07900d3677f..276e13c2dc1 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-add-row.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-add-row.spec.ts @@ -4,7 +4,8 @@ import { TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; import { DebugElement } from '@angular/core'; import { GridFunctions, GridSummaryFunctions } from '../../../test-utils/grid-functions.spec'; import { - IgxAddRowComponent, IgxGridRowEditingDefinedColumnsComponent, IgxGridRowEditingTransactionComponent + IgxAddRowComponent, IgxGridRowEditingDefinedColumnsComponent, IgxGridRowEditingTransactionComponent, + GridDynamicActionStripComponent } from '../../../test-utils/grid-samples.spec'; import { By } from '@angular/platform-browser'; @@ -45,7 +46,8 @@ describe('IgxGrid - Row Adding #grid', () => { IgxGridRowEditingTransactionComponent, IgxGridRowEditingDefinedColumnsComponent, ColumnLayoutTestComponent, - DefaultGridMasterDetailComponent + DefaultGridMasterDetailComponent, + GridDynamicActionStripComponent ], providers: [ IgxGridMRLNavigationService @@ -1121,4 +1123,34 @@ describe('IgxGrid - Row Adding #grid', () => { expect(grid.rowChangesCount).toEqual(3); }); }); + + describe('ActionStrip - Dynamic Addition', () => { + let actionStrip: IgxActionStripComponent; + + beforeEach(() => { + fixture = TestBed.createComponent(GridDynamicActionStripComponent); + fixture.detectChanges(); + grid = fixture.componentInstance.grid; + }); + + it('Should set outlet for actionstrip menu when added post-init', async () => { + // Verify no actionstrip initially + expect(fixture.componentInstance.actionStrip).toBeUndefined(); + expect(grid.actionStrip).toBeUndefined(); + + // Add the actionstrip dynamically + fixture.componentInstance.showActionStrip = true; + fixture.detectChanges(); + await wait(16); + + // Get reference to the actionstrip + actionStrip = fixture.componentInstance.actionStrip; + expect(actionStrip).toBeDefined(); + expect(grid.actionStrip).toBeDefined(); + + // Verify that the outlet is properly set + expect(actionStrip.menuOverlaySettings.outlet).toBeDefined(); + expect(actionStrip.menuOverlaySettings.outlet).toBe(grid.outlet); + }); + }); }); diff --git a/projects/igniteui-angular/test-utils/grid-samples.spec.ts b/projects/igniteui-angular/test-utils/grid-samples.spec.ts index 05685a5cd69..7cf8a9e9aec 100644 --- a/projects/igniteui-angular/test-utils/grid-samples.spec.ts +++ b/projects/igniteui-angular/test-utils/grid-samples.spec.ts @@ -2419,6 +2419,54 @@ export class IgxAddRowComponent implements OnInit { } } +@Component({ + template: ` + + @for (c of columns; track c.field) { + + } + + @if (showActionStrip) { + + + + } + +`, + imports: [ + IgxGridComponent, + IgxColumnComponent, + IgxActionStripComponent, + IgxGridEditingActionsComponent + ] +}) +export class GridDynamicActionStripComponent implements OnInit { + @ViewChild('actionStrip', { read: IgxActionStripComponent }) + public actionStrip: IgxActionStripComponent; + + @ViewChild('grid', { read: IgxGridComponent, static: true }) + public grid: IgxGridComponent; + + public data: any[]; + public columns: any[]; + public showActionStrip = false; + + public ngOnInit() { + this.columns = [ + { field: 'ID', width: '200px' }, + { field: 'CompanyName', width: '200px' }, + { field: 'ContactName', width: '200px' } + ]; + + this.data = [ + { ID: 'ALFKI', CompanyName: 'Alfreds Futterkiste', ContactName: 'Maria Anders' }, + { ID: 'ANATR', CompanyName: 'Ana Trujillo Emparedados y helados', ContactName: 'Ana Trujillo' }, + { ID: 'ANTON', CompanyName: 'Antonio Moreno Taquería', ContactName: 'Antonio Moreno' } + ]; + } +} + @Component({ template: GridTemplateStrings.declareGrid(` [hideGroupedColumns]="true"`, '', ColumnDefinitions.exportGroupedDataColumns), imports: [IgxGridComponent, IgxColumnComponent]