import React from 'react'; import 'jest-styled-components'; import { fireEvent, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { axe } from 'jest-axe'; import 'jest-axe/extend-expect'; import 'regenerator-runtime/runtime'; import '@testing-library/jest-dom'; import { Calendar as CalendarIcon, Clock as ClockIcon } from 'grommet-icons'; import { createPortal, expectPortal } from '../../../utils/portal'; import { Grommet } from '../../Grommet'; import { Button } from '../../Button'; import { DateInput } from '..'; import { Form } from '../../Form'; import { FormField } from '../../FormField'; const DATE = '2020-07-02T00:00:00-08:00'; const DATE_FIRST = '2020-07-01T00:00:00-08:00'; const DATES = ['2020-07-02T00:00:00-08:00', '2020-07-07T00:00:00-08:00']; const DATE_NOTZ = '2020-07-02'; const DATES_NOTZ = ['2020-07-02', '2020-07-07']; describe('DateInput', () => { beforeEach(createPortal); test('should reset date if passed empty string', async () => { const Test = () => { const [value, setValue] = React.useState(DATE); return (