import { render } from '../../../utils/theme-render-wrapper';

import { DrawerButton } from './drawer-button';

const onClick = jest.fn();

describe('<DrawerButton />', () => {
  it('should render on left side', () => {
    const { baseElement } = render(<DrawerButton title="title" onClick={onClick} side="left" />);
    const buttonEl = baseElement.querySelector('button');
    buttonEl?.click();
    expect(onClick).toHaveBeenCalled();
  });

  it('should render on left right', () => {
    const { baseElement } = render(<DrawerButton title="title" onClick={onClick} side="right" />);
    const buttonEl = baseElement.querySelector('button');
    buttonEl?.click();
    expect(onClick).toHaveBeenCalled();
  });
});
