diff --git a/spec/notificationComp.spec.ts b/spec/notificationComp.spec.ts index 7f13127e..240c3039 100644 --- a/spec/notificationComp.spec.ts +++ b/spec/notificationComp.spec.ts @@ -128,4 +128,14 @@ describe('Toast notification component', () => { toastNotificationReplyButton = wrapper.find(replyButtonSelector); expect(toastNotificationReplyButton.exists()).toBeTruthy(); }); + + it('should trigger mouse hovering function while hovering a notification', async () => { + const spy = jest.spyOn(ipcRenderer, 'send'); + const notificationContainer = wrapper.find( + '[data-testid="NOTIFICATION_CONTAINER"]', + ); + expect(notificationContainer).toBeTruthy(); + notificationContainer.simulate('mouseenter'); + expect(spy).toBeCalledWith('notification-mouseenter', 0); + }); }); diff --git a/src/renderer/components/notification-comp.tsx b/src/renderer/components/notification-comp.tsx index d7f077e5..2f846be7 100644 --- a/src/renderer/components/notification-comp.tsx +++ b/src/renderer/components/notification-comp.tsx @@ -157,6 +157,7 @@ export default class NotificationComp extends React.Component< containerCssClass += customCssClasses.join(' '); return (
{this.renderImage(icon)}