diff --git a/src/pages/calendar/CustomizeCalendarForm.spec.tsx b/src/pages/calendar/CustomizeCalendarForm.spec.tsx index ed439bc..017a0ba 100644 --- a/src/pages/calendar/CustomizeCalendarForm.spec.tsx +++ b/src/pages/calendar/CustomizeCalendarForm.spec.tsx @@ -60,6 +60,11 @@ describe('CustomizeCalendarForm', () => { it('sends calendar data to onChange callback', () => { expect(onChange).toHaveBeenCalledWith({ year: 2020, month: 1 }); }); + + it('sends calendar data to callback', () => { + userEvent.click(screen.getByRole('button', { name: /print/i })); + expect(onPrint).toHaveBeenCalledWith({ year: 2020, month: 1 }); + }); }); }); }); diff --git a/src/pages/calendar/CustomizeCalendarForm.tsx b/src/pages/calendar/CustomizeCalendarForm.tsx index a0447e5..0b88ee5 100644 --- a/src/pages/calendar/CustomizeCalendarForm.tsx +++ b/src/pages/calendar/CustomizeCalendarForm.tsx @@ -64,10 +64,7 @@ function CustomizeCalendarForm(props: CustomizeCalendarFormProps): JSX.Element { const onSubmit = (event: FormEvent) => { event.preventDefault(); - onPrint({ - year: currentYear, - month: currentMonth, - }); + onPrint(data); }; const changeHandler = (field: string) => (event: ChangeEvent<{ value: unknown, }>) => { @@ -126,6 +123,7 @@ function CustomizeCalendarForm(props: CustomizeCalendarFormProps): JSX.Element { type="submit" variant="contained" color="primary" + size="large" className={classes.submit} > Print Calendar