content: /* eslint-disable no-unused-expressions */
  
  import React from 'react';
  import { expect } from 'chai';
  import {
      fullRender,
      shallowRender,
      getMissingFieldError,
      change,
      getDomNode
  } from '../../utils';
  import SelectField from '../../../src/components/stateless/SelectField';
  import basicFieldTests from '../BasicFieldTests';
  
  const options = {
      '001': 'First',
      '002': 'Second',
      '003': 'Third'
  };
  
  const validProps = {
      'name': 'test',
      'value': '002',
      options,
      'onUpdate': () => {}
  };
  
  describe('SelectField', () => {
      describe('Basic field tests', basicFieldTests(SelectField, validProps));
  
      describe('Prop tests', () => {
          it('Should throw an error missing options', () => {
              expect(() => {
                  shallowRender(<SelectField name="test" />);
              }).to.throw(Error, getMissingFieldError('options'));
          });
          it('Should accept valid props', () => {
              const component = shallowRender(<SelectField { ...validProps } />);
              expect(component.type).to.equal('select');
              expect(component.props.name).to.equal('test');
              expect(component.props.value).to.equal('002');
              expect(component.props.onUpdate).to.be.function;
          });
          it('Optional instances have placeholder option', () => {
              const component = fullRender(
                  <SelectField name="test"
                          value="002"
                          options={ options }
                          optional />
              );
  
              const renderedDOM = getDomNode(component);
              const renderedOptions = renderedDOM.querySelectorAll('option');
              expect(renderedOptions.length).to.equal(4);
          });
      });
  
      describe('Click tests', () => {
          it('Should execute change handler on change', () => {
              let tmp = false;
              const component = fullRender(<SelectField name="test"
                      value="002"
                      options={ options }
                      onUpdate={ function (name, value) {
                          tmp = [name, value];
                      } } />);
              change(component, { 'target': { 'name': 'test', 'value': '003' } });
              expect(tmp[0]).to.equal('test');
              expect(tmp[1]).to.equal('003');
          });
          it('Should do nothing without change handler', () => {
              const component = fullRender(<SelectField name="test"
                      value="002"
                      options={ options } />);
              change(component);
          });
      });
  });