diff --git a/lib/demo/__tests__/fixtures.test.ts b/lib/demo/__tests__/fixtures.test.ts index a8d80dbca..093ead4f9 100644 --- a/lib/demo/__tests__/fixtures.test.ts +++ b/lib/demo/__tests__/fixtures.test.ts @@ -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'); + }); }); diff --git a/lib/demo/fixtures/vacation.ts b/lib/demo/fixtures/vacation.ts index 927f1a844..3d1d92fd1 100644 --- a/lib/demo/fixtures/vacation.ts +++ b/lib/demo/fixtures/vacation.ts @@ -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: '

Thank you for your mail. I am at Infra Summit in Lisbon and reading mail slowly until next week.

For anything about the Beacon launch, Alice Johnson has the plan. For customer questions, support@meridianlabs.example answers within a business day.

Nora

',