hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Unexpected test result #550

Closed DawnMD closed 2 years ago

DawnMD commented 2 years ago

Subject of the issue

After integrating the package with project, when testing the integration it always shows the last month of the maxDate irrespective of the startDate and endDate initialized in the range. For eg: During test, if the startDate in the range is 02 Feb 2022, after opening the calendar the first month is shown as July 2035

[BUG] Bug Reproduce Steps

  1. Integrate the component
  2. Pass a range from today to today+1
  3. Write a test file for the same
  4. Set the same range
  5. screen.debug()
  6. It will show the last month for the calendar instead of the selected month

[BUG] Expected behaviour

Test should show the month for the current selected date

Environment

Package Version: 1.4.0 React version: 17.0.1 Node version: v16.13.1 Browser: Chrome 97