import React from 'react'; import { render } from '@testing-library/react'; import 'jest-styled-components'; import { Grommet } from '../../Grommet'; import { Box, BoxProps } from '..'; describe('Box', () => { test('direction', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('responsive', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('wrap', () => { const wrapProps: BoxProps['wrap'][] = [true, false, 'reverse']; const { container } = render( {wrapProps.map((wrap) => ( ))} , ); expect(container.firstChild).toMatchSnapshot(); }); test('justify', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('align', () => { const { container } = render( {/* Mapped values */} {/* Any valid CSS align-items strings */} , ); expect(container.firstChild).toMatchSnapshot(); }); test('alignContent', () => { const { container } = render( {/* Mapped values */} {/* Any valid CSS align-content strings */} , ); expect(container.firstChild).toMatchSnapshot(); }); // the test is being skipped until we change styled box to use attrs test('alignSelf', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('basis', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('flex', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('fill', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('gap', () => { const { container } = render( {['xsmall', 'small', 'medium', 'large', '80px', 'none'].map((gap) => ( ))} first second , ); expect(container.firstChild).toMatchSnapshot(); }); test('css gap', () => { const { container } = render( {['xsmall', 'small', 'medium', 'large', '80px', 'none'].map((gap) => ( ))} first second , ); expect(container.firstChild).toMatchSnapshot(); }); test('margin', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('pad', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('gridArea', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('width', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('width object', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('height', () => { const { container } = render( , ); expect(container.firstChild).toMatchSnapshot(); }); test('renders border=between and gap=pixel value', () => { const { container } = render( Test 1 Test 2 , ); expect(container.firstChild).toMatchSnapshot(); }); });