import React from 'react'
import { shallow } from 'enzyme'
import Dropdown from '.'

describe('components/Sliders/components/Dropdown', () => {
  let dropdown
  let dropdownData = {
    options: [
      {
        value: 'firstOption',
        name: 'first option'
      },
      {
        value: 'secondOption',
        name: 'second option'
      }
    ],
    name: 'testSelect',
    value: 'secondOption',
    onChange: jest.fn()
  }

  it('should return 2 option elements', () => {
    dropdown = shallow(<Dropdown {...dropdownData} />)
    expect(dropdown.find('option')).toHaveLength(2)
  })

  it('should match snapshot', () => {
    dropdown = shallow(<Dropdown {...dropdownData} />)
    expect(dropdown).toMatchSnapshot()
  })
})
