import React from 'react';
import { shallow } from 'enzyme';

import Toggle from '.';

describe('Toggle', () => {
  it('displays a toggle', () => {
    const node = shallow(<Toggle />);
    expect(node.hasClass('Toggle')).toBe(true);
  });

  it('displays a toggle with type "checkbox"', () => {
    const node = shallow(<Toggle type="checkbox" />);
    expect(node.hasClass('Toggle_checkbox')).toBe(true);
  });

  it('displays a toggle with type "radio"', () => {
    const node = shallow(<Toggle type="radio" />);
    expect(node.hasClass('Toggle_radio')).toBe(true);
  });

  it('displays a toggle with type "toggle", with default small size', () => {
    const node = shallow(<Toggle type="toggle" />);
    expect(node.hasClass('Toggle_toggle Toggle_toggle_md')).toBe(true);
  });

  it('displays a toggle with type "toggle", but large', () => {
    const node = shallow(<Toggle size="lg" type="toggle" />);
    expect(node.hasClass('Toggle_toggle Toggle_toggle_lg')).toBe(true);
  });
});
