@@ -57,7 +57,6 @@ import { GridOption } from '../../models';
5757import { MockSlickEvent , MockSlickEventHandler } from '../../../../../../test/mockSlickEvent' ;
5858import { RxJsResourceStub } from '../../../../../../test/rxjsResourceStub' ;
5959
60- // const slickEventHandler = new MockSlickEventHandler();
6160jest . mock ( 'flatpickr' , ( ) => { } ) ;
6261
6362const 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