Fix email recipient comparison (#1184)
## Description M365 overrides recipient names if the email is known so don't compare that while checking. Similar updates will likely be needed for other fields like [B]CC in the future. ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) * closes #1183 ## Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
a32f86e40d
commit
8c495f8866
@ -193,6 +193,17 @@ func attachmentEqual(
|
||||
return true
|
||||
}
|
||||
|
||||
func recipientEqual(
|
||||
expected models.Recipientable,
|
||||
got models.Recipientable,
|
||||
) bool {
|
||||
// Don't compare names as M365 will override the name if the address is known.
|
||||
return emptyOrEqual(
|
||||
expected.GetEmailAddress().GetAddress(),
|
||||
got.GetEmailAddress().GetAddress(),
|
||||
)
|
||||
}
|
||||
|
||||
func checkMessage(
|
||||
t *testing.T,
|
||||
expected models.Messageable,
|
||||
@ -265,7 +276,7 @@ func checkMessage(
|
||||
|
||||
testEmptyOrEqual(t, expected.GetSubject(), got.GetSubject(), "Subject")
|
||||
|
||||
assert.Equal(t, expected.GetToRecipients(), got.GetToRecipients(), "ToRecipients")
|
||||
testElementsMatch(t, expected.GetToRecipients(), got.GetToRecipients(), recipientEqual)
|
||||
|
||||
// Skip WebLink as it's tied to this specific instance of the item.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user