import React from 'react';
import { render } from '~/testUtils/helpers';
import { ButtonSmall } from '..';

describe('<ButtonSmall />', () => {
  it('matches a snapshot when used without properties', () => {
    const { container } = render(<ButtonSmall />);

    expect(container.firstChild).toMatchSnapshot();
  });

  it(`doesn't have minWidth set`, () => {
    const { container } = render(<ButtonSmall>content</ButtonSmall>);

    const button = container.firstChild;

    if (!button) {
      throw new Error('Element not found.');
    }

    expect(window.getComputedStyle(button as Element).minWidth).toBe('80px');
  });
});
