import React from 'react';
import { customRender } from 'test-utils';
import SidebarNav from '.';

describe('<SidebarNav />', () => {
  it('should render correctly', () => {
    const { container, getByText } = customRender(<SidebarNav>Children</SidebarNav>);
    const nav = container.firstChild;
    const children = getByText('Children');

    expect(nav).toHaveStyle('overflow-y: auto;');
    expect(nav).toContainElement(children);
  });

  it('should allow to pass any props', () => {
    const { container } = customRender(<SidebarNav data-foo="bar">Hello World</SidebarNav>);

    expect(container.querySelector('[data-foo="bar"]')).toBeInTheDocument();
  });
});
