-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathapi-test.js
715 lines (611 loc) Β· 26.5 KB
/
api-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
'use strict';
require('dotenv').config();
const config = require('wild-config');
const supertest = require('supertest');
const test = require('node:test');
const assert = require('node:assert').strict;
const nodemailer = require('nodemailer');
const Redis = require('ioredis');
const redis = new Redis(config.dbs.redis);
const webhooksServer = require('./webhooks-server');
const accessToken = '2aa97ad0456d6624a55d30780aa2ff61bfb7edc6fa00935b40814b271e718660';
const server = supertest.agent(`http://127.0.0.1:${config.api.port}`).auth(accessToken, { type: 'bearer' });
let testAccount;
const defaultAccountId = 'main-account';
const gmailAccountId1 = 'gmail-account1';
const gmailAccountId2 = 'gmail-account2';
test('API tests', async t => {
let message2;
let oauth2PubsubId;
let oauth2AppId;
let gmailReceivedEmailId;
let gmailReceivedMessageId;
t.before(async () => {
testAccount = await nodemailer.createTestAccount();
await webhooksServer.init();
});
t.after(async () => {
redis.quit();
await webhooksServer.quit();
});
await t.test('list existing users (empty list)', async () => {
const response = await server.get(`/v1/accounts`).expect(200);
assert.strictEqual(response.body.accounts.length, 0);
});
await t.test('Verify IMAP account', async () => {
const response = await server
.post(`/v1/verifyAccount`)
.send({
mailboxes: true,
imap: {
host: testAccount.imap.host,
port: testAccount.imap.port,
secure: testAccount.imap.secure,
auth: {
user: testAccount.user,
pass: testAccount.pass
}
},
smtp: {
host: testAccount.smtp.host,
port: testAccount.smtp.port,
secure: testAccount.smtp.secure,
auth: {
user: testAccount.user,
pass: testAccount.pass
}
}
})
.expect(200);
assert.strictEqual(response.body.imap.success, true);
assert.strictEqual(response.body.smtp.success, true);
// Check if Inbox folder exists
assert.ok(response.body.mailboxes.some(mb => mb.specialUse === '\\Inbox'));
});
await t.test('Register new IMAP account', async () => {
const response = await server
.post(`/v1/account`)
.send({
account: defaultAccountId,
name: 'Test User π«₯',
email: testAccount.user,
imap: {
host: testAccount.imap.host,
port: testAccount.imap.port,
secure: testAccount.imap.secure,
auth: {
user: testAccount.user,
pass: testAccount.pass
},
resyncDelay: 60 * 1000
},
smtp: {
host: testAccount.smtp.host,
port: testAccount.smtp.port,
secure: testAccount.smtp.secure,
auth: {
user: testAccount.user,
pass: testAccount.pass
}
}
})
.expect(200);
assert.strictEqual(response.body.state, 'new');
});
await t.test('wait until added account is available', async () => {
// wait until connected
let available = false;
while (!available) {
await new Promise(r => setTimeout(r, 1000));
const response = await server.get(`/v1/account/${defaultAccountId}`).expect(200);
switch (response.body.state) {
case 'authenticationError':
case 'connectError':
throw new Error('Invalid account state ' + response.body.state);
case 'connected':
available = true;
break;
}
}
// check if we have all expected webhooks
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
for (let event of ['accountAdded', 'authenticationSuccess', 'accountInitialized']) {
assert.ok(webhooks.some(wh => wh.event === event));
}
});
await t.test('list existing users (1 account)', async () => {
const response = await server.get(`/v1/accounts`).expect(200);
assert.strictEqual(response.body.accounts.length, 1);
});
await t.test('check if account credentials are encrypted', async () => {
let accountData = await redis.hgetall(`iad:${defaultAccountId}`);
let imapData = JSON.parse(accountData.imap);
let smtpData = JSON.parse(accountData.smtp);
assert.ok(imapData.auth.pass.indexOf('$wd01$') === 0);
assert.ok(smtpData.auth.pass.indexOf('$wd01$') === 0);
});
await t.test('list mailboxes for an account', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/mailboxes`).expect(200);
assert.ok(response.body.mailboxes.some(mb => mb.specialUse === '\\Inbox'));
});
await t.test('list inbox messages (empty)', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/messages?path=INBOX`).expect(200);
assert.strictEqual(response.body.total, 0);
});
await t.test('upload email to Inbox and wait for a messageNew webhook', async () => {
const response1 = await server
.post(`/v1/account/${defaultAccountId}/message`)
.send({
path: 'Inbox',
flags: ['\\Seen'],
from: {
name: 'Test Sender',
address: '[email protected]'
},
to: [
{
name: 'Test Received',
address: '[email protected]'
}
],
subject: 'Test message π€£',
text: 'Hello world! π',
html: '<b>Hello world! π</b>',
messageId: '<[email protected]>'
})
.expect(200);
assert.ok(response1.body.id);
const response2 = await server
.post(`/v1/account/${defaultAccountId}/message`)
.send({
path: 'Inbox',
flags: [],
from: {
name: 'Test Sender',
address: '[email protected]'
},
to: [
{
name: 'Test Received',
address: '[email protected]'
}
],
subject: 'Test message π€£',
text: 'Hello world! π',
html: '<b>Hello world! π</b>',
messageId: '<[email protected]>',
attachments: [
{
filename: 'transparent.gif',
content: 'R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=',
contentType: 'image/gif',
contentDisposition: 'inline',
encoding: 'base64'
}
]
})
.expect(200);
assert.ok(response2.body.id);
let received = false;
let messageNewWebhook1 = false;
let messageNewWebhook2 = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
messageNewWebhook1 = webhooks.find(wh => wh.path === 'INBOX' && wh.event === 'messageNew' && wh.data.messageId === '<[email protected]>');
messageNewWebhook2 = webhooks.find(wh => wh.path === 'INBOX' && wh.event === 'messageNew' && wh.data.messageId === '<[email protected]>');
if (messageNewWebhook1 && messageNewWebhook2) {
received = true;
}
}
message2 = messageNewWebhook2.data;
assert.equal(messageNewWebhook1.data.subject, 'Test message π€£');
});
await t.test('list inbox messages (2 messages)', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/messages?path=INBOX`).expect(200);
assert.strictEqual(response.body.total, 2);
assert.equal(response.body.messages[0].messageId, '<[email protected]>');
});
await t.test('list mailboxes with counters', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/mailboxes?counters=true`).expect(200);
assert.ok(response.body.mailboxes.some(mb => mb.specialUse === '\\Inbox' && mb.status.messages === 2 && mb.status.unseen === 1));
});
await t.test('retrieve message text', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/text/${message2.text.id}?textType=*`).expect(200);
assert.deepEqual(response.body, { plain: 'Hello world! π', html: '<b>Hello world! π</b>', hasMore: false });
});
await t.test('download attachment', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/attachment/${message2.attachments[0].id}`).expect(200);
assert.strictEqual(response.headers['content-type'], `image/gif`);
assert.strictEqual(response.headers['content-disposition'], `attachment; filename="transparent.gif"; filename*=utf-8''transparent.gif`);
let attachment = response._body.toString('base64');
assert.strictEqual(attachment, 'R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=');
});
await t.test('get message information', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/message/${message2.id}?textType=*`).expect(200);
let message = response.body;
assert.strictEqual(message.id, message2.id);
assert.strictEqual(message.subject, 'Test message π€£');
assert.strictEqual(message.messageSpecialUse, '\\Inbox');
assert.strictEqual(message.text.plain, 'Hello world! π');
assert.strictEqual(message.text.html, '<b>Hello world! π</b>');
assert.ok(!message.text.webSafe);
});
await t.test('get message information, websafe', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/message/${message2.id}?webSafeHtml=true`).expect(200);
let message = response.body;
assert.strictEqual(message.id, message2.id);
assert.strictEqual(message.subject, 'Test message π€£');
assert.strictEqual(message.messageSpecialUse, '\\Inbox');
assert.strictEqual(message.text.plain, 'Hello world! π');
assert.strictEqual(message.text.html, '<div style="overflow: auto;"><b>Hello world! π</b></div>');
assert.strictEqual(message.text.webSafe, true);
});
await t.test('download raw message', async () => {
const response = await server.get(`/v1/account/${defaultAccountId}/message/${message2.id}/source`).expect(200);
assert.strictEqual(response.headers['content-type'], `message/rfc822`);
assert.strictEqual(response.headers['content-disposition'], `attachment; filename=message.eml`);
let eml = response.text;
assert.ok(/^Message-ID:/im.test(eml));
});
await t.test('search unseen messages', async () => {
const response = await server
.post(`/v1/account/${defaultAccountId}/search?path=INBOX`)
.send({
search: {
unseen: true
}
})
.expect(200);
assert.strictEqual(response.body.total, 1);
assert.strictEqual(response.body.messages[0].messageId, '<[email protected]>');
});
await t.test('mark message as seen', async () => {
const response = await server
.put(`/v1/account/${defaultAccountId}/message/${message2.id}`)
.send({
flags: {
add: ['\\Seen']
}
})
.expect(200);
assert.ok(response.body.flags.add);
let received = false;
let messageUpdatedWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
messageUpdatedWebhook = webhooks.find(wh => wh.path === 'INBOX' && wh.event === 'messageUpdated' && wh.data.id === message2.id);
if (messageUpdatedWebhook) {
received = true;
}
}
assert.deepEqual(messageUpdatedWebhook.data.changes.flags.added, ['\\Seen']);
});
await t.test('upload by reference', async () => {
await server
.post(`/v1/account/${defaultAccountId}/message`)
.send({
path: 'Inbox',
reference: {
message: message2.id,
action: 'forward',
inline: true,
forwardAttachments: true,
messageId: '<invalid@value>'
},
to: [
{
name: 'Test Received',
address: '[email protected]'
}
],
text: 'Hallo hallo! π',
html: '<b>Hallo hallo! π</b>',
messageId: '<[email protected]>'
})
// fails message-id test
.expect(404);
const response = await server
.post(`/v1/account/${defaultAccountId}/message`)
.send({
path: 'Inbox',
reference: {
message: message2.id,
action: 'forward',
inline: true,
forwardAttachments: true,
messageId: '<[email protected]>'
},
to: [
{
name: 'Test Received',
address: '[email protected]'
}
],
text: 'Hallo hallo! π',
html: '<b>Hallo hallo! π</b>',
messageId: '<[email protected]>'
})
.expect(200);
assert.ok(response.body.id);
let received = false;
let messageNewWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
messageNewWebhook = webhooks.find(wh => wh.path === 'INBOX' && wh.event === 'messageNew' && wh.data.messageId === '<[email protected]>');
if (messageNewWebhook) {
received = true;
}
}
assert.ok(/Begin forwarded message/.test(messageNewWebhook.data.text.plain));
assert.strictEqual(messageNewWebhook.data.attachments[0].filename, 'transparent.gif');
assert.strictEqual(messageNewWebhook.data.subject, 'Fwd: Test message π€£');
});
await t.test('submit by reference', async () => {
const response = await server
.post(`/v1/account/${defaultAccountId}/submit`)
.send({
reference: {
message: message2.id,
action: 'forward',
inline: true,
forwardAttachments: true,
messageId: '<[email protected]>'
},
to: [
{
name: 'Test Received',
address: '[email protected]'
}
],
text: 'Hallo hallo! π',
html: '<b>Hallo hallo! π</b>',
messageId: '<[email protected]>'
})
.expect(200);
assert.ok(response.body.messageId);
assert.ok(response.body.queueId);
let received = false;
let messageNewWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
messageNewWebhook = webhooks.find(wh => wh.path === 'INBOX' && wh.event === 'messageNew' && wh.data.messageId === '<[email protected]>');
if (messageNewWebhook) {
received = true;
}
}
assert.ok(/Begin forwarded message/.test(messageNewWebhook.data.text.plain));
assert.strictEqual(messageNewWebhook.data.attachments[0].filename, 'transparent.gif');
assert.strictEqual(messageNewWebhook.data.subject, 'Fwd: Test message π€£');
});
await t.test('create a mailbox', async () => {
const response = await server
.post(`/v1/account/${defaultAccountId}/mailbox`)
.send({
path: ['My Target Folder π']
})
.expect(200);
assert.strictEqual(response.body.path, 'My Target Folder π');
assert.ok(response.body.created);
let received = false;
let mailboxNewWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(defaultAccountId);
mailboxNewWebhook = webhooks.find(wh => wh.path === 'My Target Folder π' && wh.event === 'mailboxNew');
if (mailboxNewWebhook) {
received = true;
}
}
assert.ok(mailboxNewWebhook);
});
await t.test('move message to another folder', async () => {
const response = await server
.put(`/v1/account/${defaultAccountId}/message/${message2.id}/move`)
.send({
path: 'My Target Folder π'
})
.expect(200);
assert.strictEqual(response.body.path, 'My Target Folder π');
assert.strictEqual(response.body.uid, 1);
const responseSearchTarget = await server
.post(`/v1/account/${defaultAccountId}/search?path=${encodeURIComponent('My Target Folder π')}`)
.send({
search: {
uid: '1'
}
})
.expect(200);
assert.strictEqual(responseSearchTarget.body.total, 1);
assert.strictEqual(responseSearchTarget.body.messages[0].messageId, '<[email protected]>');
});
await t.test('Create Gmail API OAuth2 service project', async () => {
let gmailServiceData = {
name: 'Gmail API Pub/Sub',
provider: 'gmailService',
baseScopes: 'pubsub',
googleProjectId: process.env.GMAIL_API_PROJECT_ID,
serviceClient: process.env.GMAIL_API_SERVICE_CLIENT,
serviceClientEmail: process.env.GMAIL_API_SERVICE_EMAIL,
serviceKey: process.env.GMAIL_API_SERVICE_KEY
};
const response = await server.post(`/v1/oauth2`).send(gmailServiceData).expect(200);
oauth2PubsubId = response.body.id;
assert.ok(oauth2PubsubId);
});
await t.test('Create Gmail API OAuth2 client project', async () => {
let gmailClientData = {
name: 'Gmail API Client',
provider: 'gmail',
baseScopes: 'api',
googleProjectId: process.env.GMAIL_API_PROJECT_ID,
clientId: process.env.GMAIL_API_CLIENT_ID,
clientSecret: process.env.GMAIL_API_CLIENT_SECRET,
pubSubApp: oauth2PubsubId,
redirectUrl: 'http://127.0.0.1:7003/oauth'
};
const response = await server.post(`/v1/oauth2`).send(gmailClientData).expect(200);
oauth2AppId = response.body.id;
assert.ok(oauth2AppId);
});
await t.test('Register Gmail account 1', async () => {
const response = await server
.post(`/v1/account`)
.send({
account: gmailAccountId1,
name: 'Gmail User 1 π«₯',
email: process.env.GMAIL_API_ACCOUNT_EMAIL_1,
oauth2: {
provider: oauth2AppId,
auth: {
user: process.env.GMAIL_API_ACCOUNT_EMAIL_1
},
refreshToken: process.env.GMAIL_API_ACCOUNT_REFRESH_1
}
})
.expect(200);
assert.strictEqual(response.body.state, 'new');
});
await t.test('Register Gmail account 2', async () => {
const response = await server
.post(`/v1/account`)
.send({
account: gmailAccountId2,
name: 'Gmail User 2 π«₯',
email: process.env.GMAIL_API_ACCOUNT_EMAIL_2,
oauth2: {
provider: oauth2AppId,
auth: {
user: process.env.GMAIL_API_ACCOUNT_EMAIL_2
},
refreshToken: process.env.GMAIL_API_ACCOUNT_REFRESH_2
}
})
.expect(200);
assert.strictEqual(response.body.state, 'new');
});
await t.test('wait until Gmail accounts are available', async () => {
for (let account of [gmailAccountId1, gmailAccountId2]) {
// wait until connected
let available = false;
while (!available) {
await new Promise(r => setTimeout(r, 1000));
const response = await server.get(`/v1/account/${account}`).expect(200);
switch (response.body.state) {
case 'authenticationError':
case 'connectError':
throw new Error('Invalid account state ' + response.body.state);
case 'connected':
available = true;
break;
}
}
// check if we have all expected webhooks
let webhooks = webhooksServer.webhooks.get(account);
for (let event of ['accountAdded', 'authenticationSuccess', 'accountInitialized']) {
assert.ok(webhooks.some(wh => wh.event === event));
}
}
});
await t.test('list mailboxes for Gmail account 1', async () => {
const response = await server.get(`/v1/account/${gmailAccountId1}/mailboxes`).expect(200);
assert.ok(response.body.mailboxes.some(mb => mb.specialUse === '\\Inbox'));
});
await t.test('list inbox messages for Gmail account 1 (greeting emails)', async () => {
const response = await server.get(`/v1/account/${gmailAccountId1}/messages?path=INBOX`).expect(200);
assert.ok(response.body.total > 0);
});
await t.test('submit by API', async () => {
let messageId = `<test-${Date.now()}@example.com>`;
const response = await server
.post(`/v1/account/${gmailAccountId2}/submit`)
.send({
to: [
{
name: 'Test Account 1',
address: process.env.GMAIL_API_ACCOUNT_EMAIL_1
}
],
subject: 'Hallo hallo π€£',
text: 'Hallo hallo! π',
html: '<b>Hallo hallo! π</b>',
messageId
})
.expect(200);
assert.ok(response.body.messageId);
assert.ok(response.body.queueId);
let sent = false;
let messageSentWebhook = false;
while (!sent) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(gmailAccountId2);
messageSentWebhook = webhooks.find(wh => wh.event === 'messageSent' && wh.data.originalMessageId === messageId);
if (messageSentWebhook) {
gmailReceivedMessageId = messageSentWebhook.data.messageId;
sent = true;
}
}
let received = false;
let messageNewWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(gmailAccountId1);
messageNewWebhook = webhooks.find(wh => wh.event === 'messageNew' && wh.data.messageId === gmailReceivedMessageId);
if (messageNewWebhook) {
received = true;
}
}
// * is added by gmail
assert.strictEqual(messageNewWebhook.data.text.plain.trim(), '*Hallo hallo! π*');
assert.strictEqual(messageNewWebhook.data.messageId, gmailReceivedMessageId);
assert.strictEqual(messageNewWebhook.data.subject.trim(), 'Hallo hallo π€£');
gmailReceivedEmailId = messageNewWebhook.data.id;
assert.ok(gmailReceivedEmailId);
});
await t.test('reply by reference by API', async () => {
let messageId = `<test-${Date.now()}@example.com>`;
const response = await server
.post(`/v1/account/${gmailAccountId1}/submit`)
.send({
reference: {
message: gmailReceivedEmailId,
action: 'reply',
inline: true
},
text: 'Keedu kartul! π',
html: '<b>Keedu kartul! π</b>',
messageId
})
.expect(200);
assert.ok(response.body.messageId);
assert.ok(response.body.queueId);
let finalMessageId;
let sent = false;
let messageSentWebhook = false;
while (!sent) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(gmailAccountId1);
messageSentWebhook = webhooks.find(wh => wh.event === 'messageSent' && wh.data.originalMessageId === messageId);
if (messageSentWebhook) {
finalMessageId = messageSentWebhook.data.messageId;
sent = true;
}
}
let received = false;
let messageNewWebhook = false;
while (!received) {
await new Promise(r => setTimeout(r, 1000));
let webhooks = webhooksServer.webhooks.get(gmailAccountId2);
messageNewWebhook = webhooks.find(wh => wh.event === 'messageNew' && wh.data.messageId === finalMessageId);
if (messageNewWebhook) {
received = true;
}
}
assert.strictEqual(messageNewWebhook.data.subject.trim(), 'Re: Hallo hallo π€£');
assert.strictEqual(messageNewWebhook.data.inReplyTo, gmailReceivedMessageId);
assert.ok(messageNewWebhook);
});
});