/** * Verifies CalendarView forwards the `popup` prop to react-big-calendar so the * month grid's "+N more" overflow link opens a popover instead of being inert * (raise-simpli-3er). RBC's overflow rendering depends on real cell layout * heights, which jsdom does not compute, so we mock RBC's Calendar with a * passthrough that surfaces props into the DOM. */ import { render } from '@testing-library/react' const calendarPropSpy = jest.fn() jest.mock('react-big-calendar', () => { const actual = jest.requireActual('react-big-calendar') return { ...actual, Calendar: (props: Record) => { calendarPropSpy(props) return
}, } }) import { CalendarView } from '../calendar/calendar-view' const FIXED_DATE = new Date('2026-04-15T12:00:00Z') describe('CalendarView popup prop', () => { beforeEach(() => calendarPropSpy.mockClear()) it('defaults popup to true so the "+N more" overflow link opens a popover', () => { render() expect(calendarPropSpy).toHaveBeenCalledTimes(1) expect(calendarPropSpy.mock.calls[0][0].popup).toBe(true) }) it('forwards popup={false} when callers opt out', () => { render( , ) expect(calendarPropSpy.mock.calls[0][0].popup).toBe(false) }) })