Skip to content

Commit

Permalink
Silence console warning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed May 22, 2024
1 parent 6e73cd4 commit 30974c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/eui/src/components/date_picker/date_picker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ describe('EuiDatePicker', () => {
});

it('handles invalid `selected` dates', async () => {
// Silence the console warning from the invalid moment date
jest.spyOn(console, 'warn').mockImplementation(() => {});
const { container } = render(
<EuiDatePicker selected={moment('invalid')} />
);
Expand All @@ -38,6 +40,8 @@ describe('EuiDatePicker', () => {
expect(calendar).toBeInTheDocument();
const selected = document.querySelector('.react-datepicker__day--selected');
expect(selected).not.toBeInTheDocument();

jest.restoreAllMocks();
});

test('compressed', () => {
Expand Down

0 comments on commit 30974c6

Please sign in to comment.