diff --git a/jest.config.js b/jest.config.js index ae3399fae..b64199105 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,6 @@ const babelTargetList = [ "helper_components/custom_input\\.tsx", "calendar_test\\.test\\.tsx", "datepicker_test\\.test\\.tsx", - "multiple_selected_dates\\.test\\.tsx", ]; const tsTargetList = [ @@ -27,7 +26,7 @@ const tsTargetList = [ "month_test\\.test\\.tsx", "month_year_dropdown_test\\.test\\.tsx", "multi_month_test\\.test\\.tsx", - // "multiple_selected_dates\\.test\\.tsx", + "multiple_selected_dates\\.test\\.tsx", "run_axe\\.tsx", "show_time_test\\.test\\.tsx", "test_utils\\.ts", diff --git a/src/test/multiple_selected_dates.test.tsx b/src/test/multiple_selected_dates.test.tsx index 2032f3bc1..1a2105440 100644 --- a/src/test/multiple_selected_dates.test.tsx +++ b/src/test/multiple_selected_dates.test.tsx @@ -3,14 +3,36 @@ import React from "react"; import DatePicker from "../"; +import type { DatePickerProps } from "../index"; + describe("Multiple Dates Selected", function () { - function getDatePicker(extraProps) { + function getDatePicker( + extraProps: Partial< + Pick< + DatePickerProps, + | "selectsMultiple" + | "shouldCloseOnSelect" + | "disabledKeyboardNavigation" + | "onSelect" + > + > & + Omit< + DatePickerProps, + | "selectsMultiple" + | "onChange" + | "shouldCloseOnSelect" + | "disabledKeyboardNavigation" + | "onSelect" + | "selectsRange" + >, + ) { return render( {}} shouldCloseOnSelect={false} disabledKeyboardNavigation + onSelect={() => {}} {...extraProps} />, );