Skip to content

Commit

Permalink
fixed calendar picker test
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Jan 2, 2024
1 parent b3fe02a commit 4678d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/CalendarPickerTest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {fireEvent, render, within} from '@testing-library/react-native';
import {addMonths, addYears, subYears} from 'date-fns';
import {addMonths, addYears, subMonths, subYears} from 'date-fns';
import CalendarPicker from '../../src/components/DatePicker/CalendarPicker';
import CONST from '../../src/CONST';
import DateUtils from '../../src/libs/DateUtils';
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('CalendarPicker', () => {

fireEvent.press(getByTestId('prev-month-arrow'));

const prevMonth = new Date().getMonth() - 1;
const prevMonth = subMonths(new Date(), 1).getMonth();
expect(getByText(monthNames[prevMonth])).toBeTruthy();
});

Expand Down

0 comments on commit 4678d77

Please sign in to comment.