mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -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();
|
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', () => {
|
it('should render Symphony logo if Symphony default image provided', () => {
|
||||||
const logo = './default.png';
|
const logo = './default.png';
|
||||||
ipcRenderer.send(IPC_RENDERER_NOTIFICATION_DATA_CHANNEL, {
|
ipcRenderer.send(IPC_RENDERER_NOTIFICATION_DATA_CHANNEL, {
|
||||||
|
@ -41,7 +41,7 @@ interface INotificationState {
|
|||||||
company: string;
|
company: string;
|
||||||
body: string;
|
body: string;
|
||||||
image: string;
|
image: string;
|
||||||
icon: string;
|
icon: string | undefined;
|
||||||
id: number;
|
id: number;
|
||||||
color: string;
|
color: string;
|
||||||
flash: boolean;
|
flash: boolean;
|
||||||
@ -263,11 +263,11 @@ export default class NotificationComp extends React.Component<
|
|||||||
* Renders image if provided otherwise renders symphony logo
|
* Renders image if provided otherwise renders symphony logo
|
||||||
* @param imageUrl
|
* @param imageUrl
|
||||||
*/
|
*/
|
||||||
private renderImage(imageUrl: string): JSX.Element | undefined {
|
private renderImage(imageUrl: string | undefined): JSX.Element | undefined {
|
||||||
let imgClass = 'default-logo';
|
let imgClass = 'default-logo';
|
||||||
let url = '../renderer/assets/notification-symphony-logo.svg';
|
let url = '../renderer/assets/notification-symphony-logo.svg';
|
||||||
let alt = 'Symphony logo';
|
let alt = 'Symphony logo';
|
||||||
const isDefaultUrl = imageUrl.includes('default.png');
|
const isDefaultUrl = imageUrl && imageUrl.includes('default.png');
|
||||||
const shouldDisplayBadge = !!imageUrl && !isDefaultUrl;
|
const shouldDisplayBadge = !!imageUrl && !isDefaultUrl;
|
||||||
if (imageUrl && !isDefaultUrl) {
|
if (imageUrl && !isDefaultUrl) {
|
||||||
imgClass = 'profile-picture';
|
imgClass = 'profile-picture';
|
||||||
|
Loading…
Reference in New Issue
Block a user