mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-03 00:13:09 +00:00
fix: keep an HTML description's format when duplicating an event
This commit is contained in:
@@ -28,6 +28,12 @@ describe('buildDuplicateEventData', () => {
|
||||
expect(data.virtualLocations).not.toBe(virtualLocations);
|
||||
});
|
||||
|
||||
// Without the type the copy's HTML would be stored, and shown, as text.
|
||||
it('keeps the format of an HTML description', () => {
|
||||
const data = buildDuplicateEventData(makeEvent({ description: '<p>Daily</p>', descriptionContentType: 'text/html' }));
|
||||
expect(data).toMatchObject({ description: '<p>Daily</p>', descriptionContentType: 'text/html' });
|
||||
});
|
||||
|
||||
it('moves a timed event one day later in its own time zone with a fresh uid', () => {
|
||||
const data = buildDuplicateEventData(makeEvent());
|
||||
expect(data).toMatchObject({
|
||||
|
||||
@@ -24,6 +24,8 @@ export function buildDuplicateEventData(event: CalendarEvent): Partial<CalendarE
|
||||
freeBusyStatus: event.freeBusyStatus,
|
||||
privacy: event.privacy,
|
||||
};
|
||||
// Without its type an HTML description would be stored as plain text.
|
||||
if (event.descriptionContentType) data.descriptionContentType = event.descriptionContentType;
|
||||
if (event.locations) data.locations = structuredClone(event.locations);
|
||||
if (event.virtualLocations) data.virtualLocations = structuredClone(event.virtualLocations);
|
||||
if (event.recurrenceRules) data.recurrenceRules = structuredClone(event.recurrenceRules);
|
||||
|
||||
Reference in New Issue
Block a user