Add QOutlook copy recipients
This commit is contained in:
@@ -138,6 +138,8 @@ describe("outlookMail helpers", () => {
|
||||
const eml = [
|
||||
"From: sender@example.com",
|
||||
"To: reader@example.com",
|
||||
"Cc: copy@example.com",
|
||||
"Bcc: hidden@example.com",
|
||||
"Subject: =?UTF-8?B?0JzRg9C70YzRgtC40L/QsNGA0YI=?=",
|
||||
"Date: Mon, 01 Jun 2026 10:00:00 +0300",
|
||||
'Content-Type: multipart/alternative; boundary="alt"',
|
||||
@@ -160,6 +162,8 @@ describe("outlookMail helpers", () => {
|
||||
expect(imported.body).toBe("Привет, письмо");
|
||||
expect(imported.from).toBe("sender@example.com");
|
||||
expect(imported.to).toBe("reader@example.com");
|
||||
expect(imported.cc).toBe("copy@example.com");
|
||||
expect(imported.bcc).toBe("hidden@example.com");
|
||||
});
|
||||
|
||||
it("импортирует multipart/mixed EML с вложением", async () => {
|
||||
@@ -213,7 +217,8 @@ describe("outlookMail helpers", () => {
|
||||
messageDeliveryTime: "Mon, 01 Jun 2026 10:00:00 GMT",
|
||||
recipients: [
|
||||
{ smtpAddress: "reader@example.com", recipType: "to" },
|
||||
{ smtpAddress: "copy@example.com", recipType: "cc" }
|
||||
{ smtpAddress: "copy@example.com", recipType: "cc" },
|
||||
{ smtpAddress: "hidden@example.com", recipType: "bcc" }
|
||||
],
|
||||
attachments: [{ fileName: "report.txt", attachMimeTag: "text/plain", contentLength: 5 }]
|
||||
}
|
||||
@@ -223,6 +228,8 @@ describe("outlookMail helpers", () => {
|
||||
folder: "inbox",
|
||||
from: "sender@example.com",
|
||||
to: "reader@example.com",
|
||||
cc: "copy@example.com",
|
||||
bcc: "hidden@example.com",
|
||||
subject: "MSG отчет",
|
||||
body: "HTML текст",
|
||||
time: "Mon, 01 Jun 2026 10:00:00 GMT",
|
||||
@@ -249,6 +256,8 @@ describe("outlookMail helpers", () => {
|
||||
folder: "sent",
|
||||
from: "sender@example.com",
|
||||
to: "reader@example.com",
|
||||
cc: "copy@example.com",
|
||||
bcc: "hidden@example.com",
|
||||
subject: "Тема",
|
||||
body: "Текст",
|
||||
time: "Mon, 01 Jan 2024 10:00:00 +0000",
|
||||
@@ -259,6 +268,8 @@ describe("outlookMail helpers", () => {
|
||||
const eml = buildEmlSource(message);
|
||||
|
||||
expect(eml).toContain("From: sender@example.com");
|
||||
expect(eml).toContain("Cc: copy@example.com");
|
||||
expect(eml).toContain("Bcc: hidden@example.com");
|
||||
expect(eml).toContain("Subject: =?UTF-8?B?");
|
||||
expect(eml.endsWith("Текст")).toBe(true);
|
||||
});
|
||||
@@ -269,6 +280,8 @@ describe("outlookMail helpers", () => {
|
||||
folder: "sent",
|
||||
from: "sender@example.com",
|
||||
to: "reader@example.com",
|
||||
cc: "copy@example.com",
|
||||
bcc: "hidden@example.com",
|
||||
subject: "Тема",
|
||||
body: "Текст",
|
||||
time: "Mon, 01 Jan 2024 10:00:00 +0000",
|
||||
@@ -291,6 +304,8 @@ describe("outlookMail helpers", () => {
|
||||
const attachments = extractMessageAttachments(parsed.headers, parsed.body);
|
||||
|
||||
expect(eml).toContain("Content-Type: multipart/mixed");
|
||||
expect(eml).toContain("Cc: copy@example.com");
|
||||
expect(eml).toContain("Bcc: hidden@example.com");
|
||||
expect(eml).toContain("filename*=utf-8''%D0%BE%D1%82%D1%87%D0%B5%D1%82%2E%74%78%74");
|
||||
expect(extractMessageBody(parsed.headers, parsed.body)).toBe("Текст");
|
||||
expect(attachments[0]).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user