Skip to content

Commit 9f7e04a

Browse files
committed
test(elements): add test for actionButtons content query population
1 parent 26bef31 commit 9f7e04a

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
1+
import { IgxActionStripComponent, IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
22
import { html } from 'lit';
33
import { firstValueFrom, fromEvent, skip, timer } from 'rxjs';
44
import { ComponentRefKey, IgcNgElement } from './custom-strategy';
@@ -235,6 +235,23 @@ describe('Elements: ', () => {
235235
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
236236
});
237237

238+
it('should populate action strip actionButtons content query.', async () => {
239+
const innerHtml = `
240+
<igc-grid id="testGrid" auto-generate>
241+
<igc-action-strip id="testStrip">
242+
<igc-grid-editing-actions add-row="true"></igc-grid-editing-actions>
243+
</igc-action-strip>
244+
</igc-grid>`;
245+
testContainer.innerHTML = innerHtml;
246+
247+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
248+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
249+
250+
const actionStrip = document.querySelector<IgcNgElement>('#testStrip');
251+
const actionStripComponent = (await actionStrip.ngElementStrategy[ComponentRefKey]).instance as IgxActionStripComponent;
252+
expect(actionStripComponent.actionButtons.toArray().length).toBeGreaterThan(0);
253+
});
254+
238255
it('should not destroy action strip when row it is shown in is destroyed or cached.', async() => {
239256
const innerHtml = `
240257
<igc-grid id="testGrid" auto-generate>

0 commit comments

Comments
 (0)