diff --git a/packages/core/src/defer/dom_triggers.ts b/packages/core/src/defer/dom_triggers.ts index 5a1b74d4901d3..cbe727e1216ce 100644 --- a/packages/core/src/defer/dom_triggers.ts +++ b/packages/core/src/defer/dom_triggers.ts @@ -47,10 +47,10 @@ const interactionTriggers = new WeakMap(); const viewportTriggers = new WeakMap(); /** Names of the events considered as interaction events. */ -const interactionEventNames = ['click', 'keydown'] as const; +export const interactionEventNames = ['click', 'keydown'] as const; /** Names of the events considered as hover events. */ -const hoverEventNames = ['mouseenter', 'focusin'] as const; +export const hoverEventNames = ['mouseenter', 'mouseover', 'focusin'] as const; /** `IntersectionObserver` used to observe `viewport` triggers. */ let intersectionObserver: IntersectionObserver | null = null; diff --git a/packages/core/test/acceptance/defer_spec.ts b/packages/core/test/acceptance/defer_spec.ts index bdb0dec480114..ce10820403cb5 100644 --- a/packages/core/test/acceptance/defer_spec.ts +++ b/packages/core/test/acceptance/defer_spec.ts @@ -3027,8 +3027,9 @@ describe('@defer', () => { fixture.detectChanges(); flush(); - expect(spy).toHaveBeenCalledTimes(2); + expect(spy).toHaveBeenCalledTimes(3); expect(spy).toHaveBeenCalledWith('mouseenter', jasmine.any(Function), jasmine.any(Object)); + expect(spy).toHaveBeenCalledWith('mouseover', jasmine.any(Function), jasmine.any(Object)); expect(spy).toHaveBeenCalledWith('focusin', jasmine.any(Function), jasmine.any(Object)); })); @@ -3062,8 +3063,9 @@ describe('@defer', () => { fixture.componentInstance.renderBlock = false; fixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(2); + expect(spy).toHaveBeenCalledTimes(3); expect(spy).toHaveBeenCalledWith('mouseenter', jasmine.any(Function), jasmine.any(Object)); + expect(spy).toHaveBeenCalledWith('mouseover', jasmine.any(Function), jasmine.any(Object)); expect(spy).toHaveBeenCalledWith('focusin', jasmine.any(Function), jasmine.any(Object)); })); @@ -3098,8 +3100,9 @@ describe('@defer', () => { fixture.componentInstance.renderBlock = false; fixture.detectChanges(); - expect(spy).toHaveBeenCalledTimes(2); + expect(spy).toHaveBeenCalledTimes(3); expect(spy).toHaveBeenCalledWith('mouseenter', jasmine.any(Function), jasmine.any(Object)); + expect(spy).toHaveBeenCalledWith('mouseover', jasmine.any(Function), jasmine.any(Object)); expect(spy).toHaveBeenCalledWith('focusin', jasmine.any(Function), jasmine.any(Object)); })); @@ -4021,12 +4024,17 @@ describe('@defer', () => { fixture.detectChanges(); // Verify that trigger element is cleaned up. - expect(triggerSpy).toHaveBeenCalledTimes(2); + expect(triggerSpy).toHaveBeenCalledTimes(3); expect(triggerSpy).toHaveBeenCalledWith( 'mouseenter', jasmine.any(Function), jasmine.any(Object), ); + expect(triggerSpy).toHaveBeenCalledWith( + 'mouseover', + jasmine.any(Function), + jasmine.any(Object), + ); expect(triggerSpy).toHaveBeenCalledWith( 'focusin', jasmine.any(Function), @@ -4034,12 +4042,17 @@ describe('@defer', () => { ); // Verify that prefetch trigger element is cleaned up. - expect(prefetchSpy).toHaveBeenCalledTimes(2); + expect(prefetchSpy).toHaveBeenCalledTimes(3); expect(prefetchSpy).toHaveBeenCalledWith( 'mouseenter', jasmine.any(Function), jasmine.any(Object), ); + expect(prefetchSpy).toHaveBeenCalledWith( + 'mouseover', + jasmine.any(Function), + jasmine.any(Object), + ); expect(prefetchSpy).toHaveBeenCalledWith( 'focusin', jasmine.any(Function),