@@ -4,19 +4,11 @@ import { UserProfile, normalizeEnsName } from '@dm3-org/dm3-lib-profile';
4
4
import { BigNumber , ethers } from 'ethers' ;
5
5
import { testData } from '../../../../test-data/encrypted-envelops.test' ;
6
6
import { stringify } from '../../shared/src/stringify' ;
7
-
8
7
import { getConversationId , getMessages , incomingMessage } from './Messages' ;
9
8
import { Session } from './Session' ;
10
9
import { SpamFilterRules } from './spam-filter/SpamFilterRules' ;
11
-
12
- import {
13
- NEW_MSG_EMAIL_TEMPLATE ,
14
- NEW_MSG_EMAIL_SUBJECT ,
15
- } from './notifications/templates/newMessage' ;
16
- import {
17
- NotificationChannelType ,
18
- NotificationType ,
19
- } from './notifications/types' ;
10
+ import { NotificationChannelType } from './notifications/types' ;
11
+ import { getDeliveryServiceProperties } from '../../../backend/src/config/getDeliveryServiceProperties' ;
20
12
21
13
const SENDER_NAME = 'alice.eth' ;
22
14
const RECEIVER_NAME = 'bob.eth' ;
@@ -458,8 +450,9 @@ describe('Messages', () => {
458
450
{
459
451
type : NotificationChannelType . EMAIL ,
460
452
config : {
461
- recipientEmailId :
'[email protected] ' ,
462
- notificationType : NotificationType . NEW_MESSAGE ,
453
+ recipientEmailId :
'[email protected] ' ,
454
+ isVerified : true ,
455
+ isEnabled : true ,
463
456
} ,
464
457
} ,
465
458
] ) ;
@@ -484,18 +477,7 @@ describe('Messages', () => {
484
477
keysA . signingKeyPair ,
485
478
keysA . encryptionKeyPair ,
486
479
2 ** 14 ,
487
- [
488
- {
489
- type : NotificationChannelType . EMAIL ,
490
- config : {
491
-
492
- port : 1234 ,
493
-
494
- password : 'bar' ,
495
-
496
- } ,
497
- } ,
498
- ] ,
480
+ getDeliveryServiceProperties ( ) . notificationChannel ,
499
481
getSession ,
500
482
storeNewMessage ,
501
483
sendMessageViaSocketMock ,
@@ -507,14 +489,8 @@ describe('Messages', () => {
507
489
getNotificationChannels ,
508
490
) ;
509
491
510
- expect ( sendMailMock ) . toHaveBeenCalledWith ( {
511
-
512
- html : NEW_MSG_EMAIL_TEMPLATE (
513
- testData . delvieryInformationBUnecrypted ,
514
- ) ,
515
- subject : NEW_MSG_EMAIL_SUBJECT ,
516
-
517
- } ) ;
492
+ expect ( sendMailMock ) . toHaveBeenCalled ( ) ;
493
+
518
494
//Check if the message was submitted to the socket
519
495
expect ( sendMessageViaSocketMock ) . not . toBeCalled ( ) ;
520
496
} ) ;
0 commit comments