Files
webmail/lib/__tests__/event-modal-status-fields.test.ts
T
Linus Rath 990c5e0f77 fix: edit or answer one occurrence of a series on Stalwart 1.0
Stalwart 1.0 refuses series properties such as privacy and the
organizer on a single occurrence unless they repeat the series' value,
and refuses them inside a recurrence override on the base event. The
event modal sent privacy "public" on every save, so editing one
occurrence of a series without CLASS failed, and so did every change to
an occurrence the browser expanded.

- leave series and per-event keys out of changes to one occurrence
- write base-event overrides as before and, if the server refuses
  series keys there, repeat the write once without them and remember
  that
- stop resetting status, free/busy and privacy when an event is edited
2026-09-25 17:40:49 +02:00

20 lines
933 B
TypeScript

import { describe, it, expect } from 'vitest';
import { savedStatusFields } from '@/components/calendar/event-modal';
import type { CalendarEvent } from '@/lib/jmap/types';
// The event editor has no controls for status, free/busy or privacy. Saving
// used to reset every edited event to confirmed, busy and public - and on
// Stalwart 1.0 an edit of one occurrence fails when privacy differs from the
// series' (a series without CLASS has none at all).
describe('savedStatusFields', () => {
it('gives a new event the defaults', () => {
expect(savedStatusFields(null)).toEqual({ status: 'confirmed', freeBusyStatus: 'busy', privacy: 'public' });
});
it('leaves them out of an edit, keeping a tentative, free or private event as it is', () => {
const event = { id: 'e1', status: 'tentative', freeBusyStatus: 'free', privacy: 'private' } as CalendarEvent;
expect(savedStatusFields(event)).toEqual({});
});
});