mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
SDA-3281 Client 1.5 not sending user picture in Settings > Alerts > See sample
This commit is contained in:
parent
9af4cd164f
commit
3c41cf8e50
@ -34,6 +34,16 @@ describe('Toast notification component', () => {
|
||||
expect(imageContainer.exists()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should render Symphony logo if no icon sent - Client 1.5 settings use-case with "See sample" ', () => {
|
||||
ipcRenderer.send(IPC_RENDERER_NOTIFICATION_DATA_CHANNEL, {
|
||||
...defaultProps,
|
||||
});
|
||||
const defaultLogoContainer = wrapper.find('.default-logo');
|
||||
expect(defaultLogoContainer).toBeTruthy();
|
||||
const imageContainer = wrapper.find('.profile-picture');
|
||||
expect(imageContainer.exists()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should render Symphony logo if Symphony default image provided', () => {
|
||||
const logo = './default.png';
|
||||
ipcRenderer.send(IPC_RENDERER_NOTIFICATION_DATA_CHANNEL, {
|
||||
|
@ -41,7 +41,7 @@ interface INotificationState {
|
||||
company: string;
|
||||
body: string;
|
||||
image: string;
|
||||
icon: string;
|
||||
icon: string | undefined;
|
||||
id: number;
|
||||
color: string;
|
||||
flash: boolean;
|
||||
@ -263,11 +263,11 @@ export default class NotificationComp extends React.Component<
|
||||
* Renders image if provided otherwise renders symphony logo
|
||||
* @param imageUrl
|
||||
*/
|
||||
private renderImage(imageUrl: string): JSX.Element | undefined {
|
||||
private renderImage(imageUrl: string | undefined): JSX.Element | undefined {
|
||||
let imgClass = 'default-logo';
|
||||
let url = '../renderer/assets/notification-symphony-logo.svg';
|
||||
let alt = 'Symphony logo';
|
||||
const isDefaultUrl = imageUrl.includes('default.png');
|
||||
const isDefaultUrl = imageUrl && imageUrl.includes('default.png');
|
||||
const shouldDisplayBadge = !!imageUrl && !isDefaultUrl;
|
||||
if (imageUrl && !isDefaultUrl) {
|
||||
imgClass = 'profile-picture';
|
||||
|
Loading…
Reference in New Issue
Block a user