// @flow
import React from 'react';
import { itIsAccessible } from '../../../../utils/tests';
import { Selector } from './index';
import { SelectorItem } from './selector-item';

describe('Selector', () => {
  describe('accessibility', () => {
    const TestComponent = () => (
      <div>
        <Selector
          name="selector-name"
          onChange={jest.fn()}
          stateful
          label="Label"
          hideLabel
        >
          <SelectorItem
            id="option-one"
            label="First choice"
            value="option-one"
          />
          <SelectorItem
            id="option-two"
            label="Second choice"
            value="option-two"
            disabled
          />
          <SelectorItem
            id="option-three"
            label="Third choice"
            value="option-three"
          />
        </Selector>
      </div>
    );

    itIsAccessible(<TestComponent />);
  });
});
