diff options
Diffstat (limited to 'framework/src/domain/mime/mimetreeparser/tests')
-rw-r--r-- | framework/src/domain/mime/mimetreeparser/tests/mimetreeparsertest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/tests/mimetreeparsertest.cpp b/framework/src/domain/mime/mimetreeparser/tests/mimetreeparsertest.cpp index 97c79fe7..6b4280a9 100644 --- a/framework/src/domain/mime/mimetreeparser/tests/mimetreeparsertest.cpp +++ b/framework/src/domain/mime/mimetreeparser/tests/mimetreeparsertest.cpp | |||
@@ -401,6 +401,23 @@ private slots: | |||
401 | QCOMPARE(part->signatureState(), MimeTreeParser::KMMsgFullySigned); | 401 | QCOMPARE(part->signatureState(), MimeTreeParser::KMMsgFullySigned); |
402 | QCOMPARE(otp.plainTextContent(), QString::fromUtf8("test\n\n-- \nThis is a HTML signature.\n")); | 402 | QCOMPARE(otp.plainTextContent(), QString::fromUtf8("test\n\n-- \nThis is a HTML signature.\n")); |
403 | } | 403 | } |
404 | |||
405 | void testAppleHtmlWithAttachments() | ||
406 | { | ||
407 | MimeTreeParser::ObjectTreeParser otp; | ||
408 | otp.parseObjectTree(readMailFromFile("applehtmlwithattachments.mbox")); | ||
409 | otp.decryptParts(); | ||
410 | auto partList = otp.collectContentParts(); | ||
411 | QCOMPARE(partList.size(), 1); | ||
412 | auto part = partList[0].dynamicCast<MimeTreeParser::MessagePart>(); | ||
413 | QCOMPARE(part->encryptions().size(), 0); | ||
414 | QCOMPARE(part->signatures().size(), 0); | ||
415 | QCOMPARE(otp.plainTextContent(), QString::fromUtf8("Hi,\n\nThis is an HTML message with attachments.\n\nCheers,\nChristian")); | ||
416 | QCOMPARE(otp.htmlContent(), QString::fromUtf8("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\"></head><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;\" class=\"\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" class=\"\"><div style=\"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;\" class=\"\">Hi,<div class=\"\"><br class=\"\"></div><blockquote style=\"margin: 0 0 0 40px; border: none; padding: 0px;\" class=\"\"><div class=\"\">This is an <b class=\"\">HTML</b> message with attachments.</div></blockquote><div class=\"\"><br class=\"\"></div><div class=\"\">Cheers,</div><div class=\"\">Christian<img apple-inline=\"yes\" id=\"B9EE68A9-83CA-41CD-A3E4-E5BA301F797A\" class=\"\" src=\"cid:F5B62D1D-E4EC-4C59-AA5A-708525C2AC3C\"></div></div></body></html>")); | ||
417 | |||
418 | auto attachments = otp.collectAttachmentParts(); | ||
419 | QCOMPARE(attachments.size(), 1); | ||
420 | } | ||
404 | }; | 421 | }; |
405 | 422 | ||
406 | QTEST_GUILESS_MAIN(InterfaceTest) | 423 | QTEST_GUILESS_MAIN(InterfaceTest) |