Skip to content

Commit

Permalink
Use lib methods and mimic well
Browse files Browse the repository at this point in the history
  • Loading branch information
MonilBhavsar committed Dec 1, 2023
1 parent dad6391 commit b7075a4
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 {addYears, subYears} from 'date-fns';
import {addMonths, addYears, subYears} from 'date-fns';
import CalendarPicker from '../../src/components/NewDatePicker/CalendarPicker';
import CONST from '../../src/CONST';
import DateUtils from '../../src/libs/DateUtils';
Expand Down Expand Up @@ -64,7 +64,7 @@ describe('CalendarPicker', () => {

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

const nextMonth = new Date().getMonth() + 1;
const nextMonth = addMonths(new Date(), 1).getMonth();
expect(getByText(monthNames[nextMonth])).toBeTruthy();
});

Expand Down

0 comments on commit b7075a4

Please sign in to comment.