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

import EmojiPicker from '.';

describe('EmojiPicker', () => {
  it('displays the <EmojiPicker> element', () => {
    const node = shallow(<EmojiPicker />);
    expect(node.hasClass('EmojiPicker')).toBe(true);
  });

  it('displays initial value', () => {
    const node = shallow(<EmojiPicker value="🦉" />);
    expect(node.state().value).toStrictEqual('🦉');
  });

  it('no emoji can be picked', () => {
    const node = shallow(<EmojiPicker />);
    node.find('button').at(0).simulate('click');
    expect(node.state().value).toStrictEqual('');
  });
});
