Skip to content

Commit

Permalink
Fixed submit by reference test
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Dec 28, 2024
1 parent c9c9784 commit fccbe91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/api-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ test('API tests', async t => {
assert.ok(response.body.messageId);
assert.ok(response.body.queueId);

let gmailReceivedMessageId;
let finalMessageId;

let sent = false;
let messageSentWebhook = false;
Expand All @@ -691,7 +691,7 @@ test('API tests', async t => {
let webhooks = webhooksServer.webhooks.get(gmailAccountId1);
messageSentWebhook = webhooks.find(wh => wh.event === 'messageSent' && wh.data.originalMessageId === messageId);
if (messageSentWebhook) {
gmailReceivedMessageId = messageSentWebhook.data.messageId;
finalMessageId = messageSentWebhook.data.messageId;
sent = true;
}
}
Expand All @@ -701,7 +701,7 @@ test('API tests', async t => {
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 === gmailReceivedMessageId);
messageNewWebhook = webhooks.find(wh => wh.event === 'messageNew' && wh.data.messageId === finalMessageId);
if (messageNewWebhook) {
received = true;
}
Expand Down

0 comments on commit fccbe91

Please sign in to comment.