Skip to content

Commit

Permalink
Merge pull request Expensify#33826 from shubham1206agra/fix-test-2
Browse files Browse the repository at this point in the history
Fixed calendar picker test
  • Loading branch information
MonilBhavsar authored Jan 2, 2024
2 parents b3fe02a + 4678d77 commit 320ff54
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 320ff54

Please sign in to comment.