test: turn on the demo out-of-office reply

This commit is contained in:
Linus Rath
2026-10-31 13:24:30 +01:00
parent fa13223c69
commit cd9a529b20
2 changed files with 20 additions and 5 deletions
+12
View File
@@ -334,4 +334,16 @@ describe('demo fixtures: audience screenshots', () => {
title: 'Engineering Lead', department: 'Platform', phone: '+49 30 555 0199', mobile: '',
});
});
it('the out-of-office reply is on for the Lisbon days on the calendar', async () => {
const reply = await new DemoJMAPClient('work').getVacationResponse();
expect(reply.isEnabled).toBe(true);
const trip = work.calendarEvents.find((e) => e.id === 'demo-event-lisbon')!;
const from = new Date(reply.fromDate!).getTime();
const to = new Date(reply.toDate!).getTime();
expect(from).toBeLessThan(to);
expect(from).toBeGreaterThanOrEqual(new Date(trip.utcStart!).getTime());
expect(to).toBeLessThanOrEqual(new Date(trip.utcEnd!).getTime());
expect(reply.textBody).toContain('Lisbon');
});
});
+8 -5
View File
@@ -1,13 +1,16 @@
import type { VacationResponse } from '@/lib/jmap/types';
import { demoDate } from '../demo-utils';
import { demoAt } from '../demo-utils';
/** Prepared for the Lisbon trip, not switched on yet. */
/**
* Switched on for the Lisbon trip (Infra Summit in fixtures/calendars.ts,
* days 9 to 12): from the morning flight out to the evening flight back.
*/
export function createDemoVacationResponse(): VacationResponse {
return {
id: 'singleton',
isEnabled: false,
fromDate: demoDate(9, 0),
toDate: demoDate(13, 0),
isEnabled: true,
fromDate: demoAt(9, 6),
toDate: demoAt(12, 22),
subject: 'Out of office: back next week',
textBody: 'Thank you for your mail. I am at Infra Summit in Lisbon and reading mail slowly until next week.\n\nFor anything about the Beacon launch, Alice Johnson (alice.johnson@meridianlabs.example) has the plan. For customer questions, support@meridianlabs.example answers within a business day.\n\nNora',
htmlBody: '<p>Thank you for your mail. I am at Infra Summit in Lisbon and reading mail slowly until next week.</p><p>For anything about the Beacon launch, <a href="mailto:alice.johnson@meridianlabs.example">Alice Johnson</a> has the plan. For customer questions, <a href="mailto:support@meridianlabs.example">support@meridianlabs.example</a> answers within a business day.</p><p>Nora</p>',