Skip to content

Commit

Permalink
test(DateRangeInput): fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarMuhamethanov committed Nov 5, 2024
1 parent 5363531 commit 03d1b53
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('DateRangeInput', () => {
jest.useFakeTimers();
const onCalendarOpenChanged = jest.fn();
const { container } = render(
<DateRangeInput value={[startDate, null]} onCalendarOpenChanged={onCalendarOpenChanged} />,
<DateRangeInput value={[startDate, endDate]} onCalendarOpenChanged={onCalendarOpenChanged} />,
);
const inputLikes = getInputsLike(container);
const [dates] = inputLikes;
Expand All @@ -154,7 +154,7 @@ describe('DateRangeInput', () => {
expect(onCalendarOpenChanged.mock.calls[0][0]).toBeTruthy();

expect(container.contains(document.activeElement)).toBeTruthy();
await userEvent.click(screen.getAllByText('15')[0]);
await userEvent.click(screen.getAllByText('15')[1]);

expect(onCalendarOpenChanged).toHaveBeenCalledTimes(2);
expect(onCalendarOpenChanged.mock.calls[1][0]).toBeFalsy();
Expand Down

0 comments on commit 03d1b53

Please sign in to comment.