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

Commit 6b0cabc

Browse files
committed
chore: add missing unit test
1 parent 193b366 commit 6b0cabc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/app/modules/angular-slickgrid/extensions/__tests__/slickRowDetailView.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,18 @@ describe('SlickRowDetailView', () => {
671671
expect(onRowOutViewSpy).not.toHaveBeenCalled();
672672
expect(onRowBackViewSpy).not.toHaveBeenCalled();
673673
});
674+
675+
it('should call internal event handler subscribe and expect the "onBeforeRowOutOfViewportRange" callback to be called', () => {
676+
const onBeforeSpy = jest.fn();
677+
gridOptionsMock.rowDetailView!.onBeforeRowOutOfViewportRange = onBeforeSpy;
678+
679+
plugin.init(gridStub);
680+
plugin.onBeforeRowOutOfViewportRange = new SlickEvent();
681+
plugin.register();
682+
plugin.onBeforeRowOutOfViewportRange.notify({ item: columnsMock[0], rowId: columnsMock[0].id, grid: gridStub } as any, new SlickEventData(), gridStub);
683+
684+
expect(onBeforeSpy).toHaveBeenCalled();
685+
});
674686
});
675687

676688
describe('possible error thrown', () => {

0 commit comments

Comments
 (0)