mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 11:56:30 +03:00
test: Record the current wrong behaviour of HTML display of multipart messages (#4462)
This commit is contained in:
@@ -3827,6 +3827,40 @@ async fn test_messed_up_message_id() -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
async fn test_big_forwarded_with_big_attachment() -> Result<()> {
|
||||||
|
let t = &TestContext::new_bob().await;
|
||||||
|
|
||||||
|
let raw = include_bytes!("../../test-data/message/big_forwarded_with_big_attachment.eml");
|
||||||
|
let rcvd = receive_imf(t, raw, false).await?.unwrap();
|
||||||
|
assert_eq!(rcvd.msg_ids.len(), 3);
|
||||||
|
let msg = Message::load_from_db(t, rcvd.msg_ids[0]).await?;
|
||||||
|
assert_eq!(msg.get_viewtype(), Viewtype::Text);
|
||||||
|
assert_eq!(msg.get_text(), "Hello!");
|
||||||
|
// Wrong: the second bubble's text is truncated, but "Show Full Message..." is going to be shown
|
||||||
|
// in the first message bubble in the UIs.
|
||||||
|
assert_eq!(
|
||||||
|
msg.id
|
||||||
|
.get_html(t)
|
||||||
|
.await?
|
||||||
|
.unwrap()
|
||||||
|
.matches("Hello!")
|
||||||
|
.count(),
|
||||||
|
1
|
||||||
|
);
|
||||||
|
let msg = Message::load_from_db(t, rcvd.msg_ids[1]).await?;
|
||||||
|
assert_eq!(msg.get_viewtype(), Viewtype::Text);
|
||||||
|
assert!(msg.get_text().starts_with("this text with 42 chars is just repeated."));
|
||||||
|
assert!(msg.get_text().ends_with("[...]"));
|
||||||
|
// Wrong: the text is truncated, but it's not possible to see the full text in HTML.
|
||||||
|
assert!(!msg.has_html());
|
||||||
|
let msg = Message::load_from_db(t, rcvd.msg_ids[2]).await?;
|
||||||
|
assert_eq!(msg.get_viewtype(), Viewtype::File);
|
||||||
|
assert!(!msg.has_html());
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn test_mua_user_adds_member() -> Result<()> {
|
async fn test_mua_user_adds_member() -> Result<()> {
|
||||||
let t = TestContext::new_alice().await;
|
let t = TestContext::new_alice().await;
|
||||||
|
|||||||
305
test-data/message/big_forwarded_with_big_attachment.eml
Normal file
305
test-data/message/big_forwarded_with_big_attachment.eml
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
From: Alice <alice@example.org>
|
||||||
|
To: Bob <bob@example.net>
|
||||||
|
Date: Fri, 2 Jun 2023 13:29:17 +0000
|
||||||
|
Message-ID: <foobar1@localhost>
|
||||||
|
Content-Type: multipart/mixed; boundary="zRs3OquGy6eU58KF"
|
||||||
|
|
||||||
|
|
||||||
|
--zRs3OquGy6eU58KF
|
||||||
|
Content-Type: text/plain; charset=us-ascii
|
||||||
|
Content-Disposition: inline
|
||||||
|
|
||||||
|
Hello!
|
||||||
|
|
||||||
|
--zRs3OquGy6eU58KF
|
||||||
|
Content-Type: message/rfc822
|
||||||
|
Content-Disposition: inline
|
||||||
|
|
||||||
|
From: AAA <aaa@example.org>
|
||||||
|
To: Alice <alice@example.org>
|
||||||
|
Subject: Some subject
|
||||||
|
Date: Fri, 2 Jun 2023 12:29:17 +0000
|
||||||
|
Message-ID: <foobar@localhost>
|
||||||
|
In-Reply-To: <barbaz@localhost>
|
||||||
|
Content-Type: multipart/mixed;
|
||||||
|
boundary="_innerboundary_"
|
||||||
|
MIME-Version: 1.0
|
||||||
|
|
||||||
|
--_innerboundary_
|
||||||
|
Content-Type: text/plain; charset="us-ascii"
|
||||||
|
Content-Transfer-Encoding: quoted-printable
|
||||||
|
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
|
||||||
|
--=20
|
||||||
|
|
||||||
|
Kind regards,
|
||||||
|
|
||||||
|
Bob
|
||||||
|
|
||||||
|
--_innerboundary_
|
||||||
|
Content-Type: text/plain; name="deltachat-log.txt"
|
||||||
|
Content-Description: deltachat-log.txt
|
||||||
|
Content-Disposition: attachment; filename="deltachat-log.txt";
|
||||||
|
size=55254; creation-date="Fri, 02 Jun 2023 11:33:49 GMT";
|
||||||
|
modification-date="Fri, 02 Jun 2023 12:29:17 GMT"
|
||||||
|
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
this text with 42 chars is just repeated.
|
||||||
|
|
||||||
|
--_innerboundary_--
|
||||||
|
|
||||||
|
--zRs3OquGy6eU58KF--
|
||||||
Reference in New Issue
Block a user