Skip to content

Test Case Failing Due to Incomplete Data Display in DatePicker Component #4283

@balajis-qb

Description

@balajis-qb

Description:

Issue:

The test case located in datepicker_test.test.js, within the describe("selectsRange with inline") block and named it("should change dates of range change startDate when endDate set before startDate") is currently failing under specific conditions.

Problem:

In the above mentioned test-case, we attempt to find a date three days before the current date within a DatePicker component.
Test case issue

However, this test case is failing in certain scenarios. The issue arises when the current date falls at the beginning of a month. In such cases, the DatePicker component does not display the previous month's data, which prevents us from selecting a date three days before the current date.
The issue screenshot

To Reproduce

Normally, this issue will not occur, but I accidentally caught it on Oct. 1, 2023, as there were no fall-over days from last month in this month's week, so the component is not rendering the last month's data.
Issue Screenshot

Suggested Solution:

To address this issue, we propose the following solution:

  1. When the current date is at the beginning of the month and the DatePicker component does not display the previous month's data, we should navigate to the previous month programmatically.
  2. After navigating to the previous month, we can then attempt to select the desired date three days before the current date.

Expected behavior

With the suggested solution in place, the test case should be able to find and select a date three days before the current date, regardless of whether it falls at the beginning of the month.

Screenshots

The issue screenshot

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions