forked from Silverfish/proton-bridge
GODT-1556: Add unit test for in-reply-to header without references.
This commit is contained in:
@ -605,6 +605,16 @@ func TestParseMessageReferencesComma(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestParseMessageReplyToWithoutReferences(t *testing.T) {
|
||||
f := getFileReader("reply-to_no_references.eml")
|
||||
|
||||
m, err := Parse(f)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.ElementsMatch(t, m.References, []string{})
|
||||
assert.Equal(t, m.InReplyTo, "OEUOEUEOUOUOU770B9QNZWFVGM@protonmail.ch")
|
||||
}
|
||||
|
||||
func TestParseIcsAttachment(t *testing.T) {
|
||||
f := getFileReader("ics_attachment.eml")
|
||||
|
||||
|
||||
26
pkg/message/testdata/reply-to_no_references.eml
vendored
Normal file
26
pkg/message/testdata/reply-to_no_references.eml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
Content-Type: multipart/mixed;
|
||||
boundary=987c7102dcaf02d01860ce777b465f86d39ec16a3b4e12605eb6b0eb200a
|
||||
X-Original-To: someone@protonmail.com
|
||||
Delivered-To: someone@protonmail.com
|
||||
Date: Sun, 04 Aug 2019 13:03:26 +0000
|
||||
From: ProtonVPN <support@protonvpn.something.com>
|
||||
Reply-To: ProtonVPN <support+id493949@protonvpn.something.com>
|
||||
To: someone <someone@protonmail.com>
|
||||
Message-Id: <OEUOEUOUOU_5d46d79df036f_1d78b3fd8f42bcf2014719e_sprut@something.com>
|
||||
In-Reply-To: <OEUOEUEOUOUOU770B9QNZWFVGM@protonmail.ch>
|
||||
Subject: Some test subject
|
||||
Mime-Version: 1.0
|
||||
|
||||
--987c7102dcaf02d01860ce777b465f86d39ec16a3b4e12605eb6b0eb200a
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
Content-Type: text/html; charset=utf-8
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
|
||||
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<body>
|
||||
test test test
|
||||
</body>
|
||||
</html>
|
||||
|
||||
--987c7102dcaf02d01860ce777b465f86d39ec16a3b4e12605eb6b0eb200a--
|
||||
Reference in New Issue
Block a user