Skip to content

Commit

Permalink
fix(test): fix testcase should not depend on today
Browse files Browse the repository at this point in the history
  • Loading branch information
sebimarkgraf committed Feb 19, 2024
1 parent 653daa8 commit db2e15b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/__tests__/api.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import 'dayjs/locale/tr';

describe('API TESTS', () => {
test('should display the passed date', () => {
const selectedDate = new Date();
const selectedDate = new Date(2020, 12, 19);
const month = selectedDate.toLocaleString('en-US', { month: 'long' });

render(<DateTimePicker mode="single" date={selectedDate} />);
expect(screen.getByText(month)).toBeVisible();
expect(screen.getByText('19')).toBeVisible();
expect(screen.getByText('2020')).toBeVisible();
});

// test('minDate should be applied after init', () => {
Expand Down

0 comments on commit db2e15b

Please sign in to comment.