vi.fn().mockResolvedValue({ /* snip */ }) const { transition } = createStateMachine({ fetchTimes }) const current = createCurrent() const result = await transition( current, calendarEvent('selectVisitDate', { visitDate: '2024-10-26' as DateText }) ) expect(result.value).toEqual('READY') expect(result.context).toEqual({ ...current.context, visitDate: '2024-10-26', selectedVisitDate: '2024-10-26', visitTime: '18:30', }) })