import * as React from 'react'; import _set from 'lodash/set'; import { Box } from '../../Box'; import { Menu } from '../index'; import render from '../../utils/_tests/render'; describe('props', () => { it('should render correctly', () => { const { container } = render(
); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with CSS props', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with dividers', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with no left padding', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with disabled items', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with icons (left)', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with icons (right)', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with addon component (left)', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with addon component (right)', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with static items', () => { const { container } = render( ); expect(container.firstChild).toMatchSnapshot(); }); }); describe('theming', () => { [ 'Menu.styles.base', 'Menu.Item.styles.base', 'Menu.Item.Content.styles.base', 'Menu.Item.ContentText.styles.base', ].forEach((key) => { it(`${key} should render correctly`, () => { let theme = {}; _set(theme, key, { backgroundColor: 'red' }); const { container } = render( , { theme, } ); expect(container.firstChild).toMatchSnapshot(); }); }); }); describe('overrides', () => { [ 'Menu.styles.base', 'Menu.Item.styles.base', 'Menu.Item.Content.styles.base', 'Menu.Item.ContentText.styles.base', ].forEach((key) => { it(`${key} should render correctly`, () => { let theme = {}; _set(theme, key, { backgroundColor: 'red' }); const { container } = render( , { theme, } ); expect(container.firstChild).toMatchSnapshot(); }); }); });