{"size": 1497, "ext": "js", "max_stars_repo_path": "src/components/Input/__tests__/AddOn.test.js", "max_stars_repo_name": "tinkertrain/hsds-react", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Input/__tests__/AddOn.test.js", "max_issues_repo_name": "tinkertrain/hsds-react", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Input/__tests__/AddOn.test.js", "max_forks_repo_name": "tinkertrain/hsds-react", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2631578947, "max_line_length": 58, "alphanum_fraction": 0.6259185037}
import React from 'react'
import { mount } from 'enzyme'
import AddOn from '../AddOn'

describe('ClassName', () => {
  test('Has default className', () => {
    const wrapper = mount(<AddOn />)

    expect(wrapper.hasClass('c-InputAddOn')).toBe(true)
  })

  test('Accepts custom className', () => {
    const className = 'milk-was-a-bad-choice'
    const wrapper = mount(<AddOn className={className} />)

    expect(wrapper.hasClass(className)).toBe(true)
  })
})

describe('Content', () => {
  test('Can render children', () => {
    const wrapper = mount(
      <AddOn>
        <span className="child">Ron</span>
      </AddOn>
    )

    expect(wrapper.find('span.child').length).toBe(1)
  })
})

describe('Styles', () => {
  test('Can render isFirst styles', () => {
    const wrapper = mount(<AddOn isFirst />)

    expect(wrapper.hasClass('is-first')).toBe(true)
    expect(wrapper.hasClass('is-notOnly')).toBe(false)
    expect(wrapper.hasClass('is-last')).toBe(false)
  })

  test('Can render isNotOnly styles', () => {
    const wrapper = mount(<AddOn isNotOnly />)

    expect(wrapper.hasClass('is-first')).toBe(false)
    expect(wrapper.hasClass('is-notOnly')).toBe(true)
    expect(wrapper.hasClass('is-last')).toBe(false)
  })

  test('Can render isLast styles', () => {
    const wrapper = mount(<AddOn isLast />)

    expect(wrapper.hasClass('is-first')).toBe(false)
    expect(wrapper.hasClass('is-notOnly')).toBe(false)
    expect(wrapper.hasClass('is-last')).toBe(true)
  })
})
