import React from 'react';
import { render } from '@testing-library/react';
import 'jest-styled-components';
import { DateString } from './DateString';

describe('DateString', () => {
   it('convert date to string', () => {
      const { container } = render(
         <div>
            <DateString date={new Date(2020, 11, 12)} format="dd MM yyyy" />
         </div>,
      );

      expect(container.firstElementChild.innerHTML).toEqual('12 12 2020');
   });
});
