Fix event cancellation status in export (#5107)
<!-- PR description--> --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
5f036a0cc1
commit
79194c44df
@ -339,7 +339,7 @@ func updateEventProperties(ctx context.Context, event models.Eventable, iCalEven
|
|||||||
|
|
||||||
// STATUS - https://www.rfc-editor.org/rfc/rfc5545#section-3.8.1.11
|
// STATUS - https://www.rfc-editor.org/rfc/rfc5545#section-3.8.1.11
|
||||||
cancelled := event.GetIsCancelled()
|
cancelled := event.GetIsCancelled()
|
||||||
if cancelled != nil {
|
if cancelled != nil && ptr.Val(cancelled) {
|
||||||
iCalEvent.SetStatus(ics.ObjectStatusCancelled)
|
iCalEvent.SetStatus(ics.ObjectStatusCancelled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -576,6 +576,19 @@ func (suite *ICSUnitSuite) TestEventConversion() {
|
|||||||
assert.Contains(t, out, "STATUS:CANCELLED", "cancelled status")
|
assert.Contains(t, out, "STATUS:CANCELLED", "cancelled status")
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "not cancelled event",
|
||||||
|
event: func() *models.Event {
|
||||||
|
e := baseEvent()
|
||||||
|
|
||||||
|
e.SetIsCancelled(ptr.To(false))
|
||||||
|
|
||||||
|
return e
|
||||||
|
},
|
||||||
|
check: func(out string) {
|
||||||
|
assert.NotContains(t, out, "STATUS:CANCELLED", "cancelled status")
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "text body",
|
name: "text body",
|
||||||
event: func() *models.Event {
|
event: func() *models.Event {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user