mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-3292 Close button hovering not taken into account to prevent notification close
This commit is contained in:
parent
2a32b127cb
commit
9bd96a4cda
@ -128,4 +128,14 @@ describe('Toast notification component', () => {
|
|||||||
toastNotificationReplyButton = wrapper.find(replyButtonSelector);
|
toastNotificationReplyButton = wrapper.find(replyButtonSelector);
|
||||||
expect(toastNotificationReplyButton.exists()).toBeTruthy();
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -157,6 +157,7 @@ export default class NotificationComp extends React.Component<
|
|||||||
containerCssClass += customCssClasses.join(' ');
|
containerCssClass += customCssClasses.join(' ');
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
data-testid='NOTIFICATION_CONTAINER'
|
||||||
className={containerCssClass}
|
className={containerCssClass}
|
||||||
style={{
|
style={{
|
||||||
height: containerHeight,
|
height: containerHeight,
|
||||||
@ -164,6 +165,8 @@ export default class NotificationComp extends React.Component<
|
|||||||
borderColor: themeColors.notificationBorderColor,
|
borderColor: themeColors.notificationBorderColor,
|
||||||
}}
|
}}
|
||||||
lang={i18n.getLocale()}
|
lang={i18n.getLocale()}
|
||||||
|
onMouseEnter={this.eventHandlers.onMouseEnter(id)}
|
||||||
|
onMouseLeave={this.eventHandlers.onMouseLeave(id)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`close-button ${themeClassName}`}
|
className={`close-button ${themeClassName}`}
|
||||||
@ -181,8 +184,6 @@ export default class NotificationComp extends React.Component<
|
|||||||
role='alert'
|
role='alert'
|
||||||
onContextMenu={this.eventHandlers.onContextMenu}
|
onContextMenu={this.eventHandlers.onContextMenu}
|
||||||
onClick={this.eventHandlers.onClick(id)}
|
onClick={this.eventHandlers.onClick(id)}
|
||||||
onMouseEnter={this.eventHandlers.onMouseEnter(id)}
|
|
||||||
onMouseLeave={this.eventHandlers.onMouseLeave(id)}
|
|
||||||
>
|
>
|
||||||
<div className='logo-container'>{this.renderImage(icon)}</div>
|
<div className='logo-container'>{this.renderImage(icon)}</div>
|
||||||
<div className='notification-container'>
|
<div className='notification-container'>
|
||||||
|
Loading…
Reference in New Issue
Block a user