import React from 'react'; import { customRender } from 'test-utils'; import Sidebar from '.'; import { SIDEBAR_WIDTH } from '../../styles/constants'; describe('', () => { it('should render correctly', () => { const { container, getByText } = customRender(Hello World); const sidebarWrapper = container.firstChild; const children = getByText('Hello World'); expect(sidebarWrapper).toHaveStyle(` width: ${SIDEBAR_WIDTH}px; background-color: #232a3b; `); expect(sidebarWrapper).toContainElement(children); }); it('should allow to pass any props', () => { const { container } = customRender(Hello World); expect(container.querySelector('[data-foo="bar"]')).toBeInTheDocument(); }); });