|
1 | 1 | import { DeliveryInformation } from '@dm3-org/dm3-lib-messaging';
|
2 |
| -import { NotificationChannelType, NotificationType } from './types'; |
| 2 | +import { |
| 3 | + NotificationChannel, |
| 4 | + NotificationChannelType, |
| 5 | + NotificationType, |
| 6 | +} from './types'; |
3 | 7 | import {
|
4 | 8 | NotificationBroker,
|
5 | 9 | _setupNotficationBroker,
|
6 | 10 | } from './broker/NotificationBroker';
|
7 |
| -import { getDeliveryServiceProperties } from '../../../../backend/src/config/getDeliveryServiceProperties'; |
8 | 11 |
|
9 | 12 | jest.mock('nodemailer');
|
10 | 13 |
|
11 | 14 | describe('Notifications', () => {
|
12 | 15 | it('Send Email notification to verify OTP', async () => {
|
13 |
| - const dsNotificationChannels = |
14 |
| - getDeliveryServiceProperties().notificationChannel; |
| 16 | + const dsNotificationChannels: NotificationChannel[] = [ |
| 17 | + { |
| 18 | + type: NotificationChannelType.EMAIL, |
| 19 | + config: { |
| 20 | + smtpHost: 'smtp.gmail.com', |
| 21 | + smtpPort: 587, |
| 22 | + |
| 23 | + smtpUsername: '[email protected]', |
| 24 | + smtpPassword: 'abcd1234', |
| 25 | + }, |
| 26 | + }, |
| 27 | + ]; |
15 | 28 |
|
16 | 29 | const channel1 = {
|
17 | 30 | type: NotificationChannelType.EMAIL,
|
@@ -56,8 +69,18 @@ describe('Notifications', () => {
|
56 | 69 | });
|
57 | 70 |
|
58 | 71 | it('Should not send email when notification channel is not verified', async () => {
|
59 |
| - const dsNotificationChannels = |
60 |
| - getDeliveryServiceProperties().notificationChannel; |
| 72 | + const dsNotificationChannels: NotificationChannel[] = [ |
| 73 | + { |
| 74 | + type: NotificationChannelType.EMAIL, |
| 75 | + config: { |
| 76 | + smtpHost: 'smtp.gmail.com', |
| 77 | + smtpPort: 587, |
| 78 | + |
| 79 | + smtpUsername: '[email protected]', |
| 80 | + smtpPassword: 'abcd1234', |
| 81 | + }, |
| 82 | + }, |
| 83 | + ]; |
61 | 84 |
|
62 | 85 | const channel1 = {
|
63 | 86 | type: NotificationChannelType.EMAIL,
|
|
0 commit comments