I have the next code in angular's component:
@HostListener('window:scroll', []) onWindowScroll() {
this.showScrollToTop = false;
}
How can I test this in jasmine? How to to initiate window scroll event?
I have the next code in angular's component:
@HostListener('window:scroll', []) onWindowScroll() {
this.showScrollToTop = false;
}
How can I test this in jasmine? How to to initiate window scroll event?
it('Focus over elements', () => {
fixture.detectChanges();
const event = new Event('click', { bubbles: true });
const spyDocumentClick = spyOn(component, 'clickout').and.callThrough();
component.clickout(event);
expect(spyDocumentClick).toHaveBeenCalled();
});