Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 1f54d41

Browse files
committed
chore: add missing unit test coverage
1 parent 1f768a5 commit 1f54d41

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/app/modules/angular-slickgrid/components/__tests__/angular-slickgrid.component.spec.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import { GridOption } from '../../models';
5757
import { MockSlickEvent, MockSlickEventHandler } from '../../../../../../test/mockSlickEvent';
5858
import { RxJsResourceStub } from '../../../../../../test/rxjsResourceStub';
5959

60-
// const slickEventHandler = new MockSlickEventHandler();
6160
jest.mock('flatpickr', () => { });
6261

6362
const mockSlickRowDetailView = {
@@ -388,6 +387,40 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
388387
expect(component.elementRef.nativeElement).toBeTruthy();
389388
});
390389

390+
it('should provide the gridService lazily', () => {
391+
const instance = new AngularSlickgridComponent(
392+
angularUtilServiceStub,
393+
mockAppRef,
394+
mockChangeDetectorRef,
395+
containerService,
396+
mockElementRef,
397+
translate as unknown as TranslateService,
398+
translaterService as unknown as TranslaterService,
399+
{} as GridOption,
400+
{
401+
backendUtilityService: backendUtilityServiceStub,
402+
collectionService: collectionServiceStub,
403+
extensionService: undefined,
404+
extensionUtility: mockExtensionUtility,
405+
eventPubSubService,
406+
filterService: filterServiceStub,
407+
gridEventService: gridEventServiceStub,
408+
gridService: gridServiceStub,
409+
gridStateService: gridStateServiceStub,
410+
groupingAndColspanService: groupingAndColspanServiceStub,
411+
resizerService: resizerServiceStub,
412+
paginationService: paginationServiceStub,
413+
sharedService,
414+
sortService: sortServiceStub,
415+
treeDataService: treeDataServiceStub,
416+
}
417+
);
418+
419+
expect(instance).toBeTruthy();
420+
expect(instance.elementRef.nativeElement).toBeTruthy();
421+
expect((instance.extensionService as any).lazyGridService()).toBeDefined();
422+
});
423+
391424
it('should load enable mousewheel event scrolling when using a frozen grid', () => {
392425
component.gridOptions = gridOptions;
393426
component.gridOptions.enableMouseWheelScrollHandler = undefined;

0 commit comments

Comments
 (0)