import React from 'react';
import {shallow} from 'enzyme';
import DevToolName from "./DevToolName";

describe('DevToolName', () => {
  it('should display devtool name', () => {
    let subject = shallow(<DevToolName>docker</DevToolName>);

    expect(subject.text()).toBe('docker');
  });

  it('should display settings icon', () => {
    let subject = shallow(<DevToolName>docker</DevToolName>);

    expect(subject.find('img').length).toBe(1);
  });

  it('should call onClick on click', () => {
    let spy = jest.fn();
    let subject = shallow(<DevToolName onClick={spy}>docker</DevToolName>);

    subject.find('div').at(0).simulate('click');

    expect(spy).toBeCalled();
  });
});

@@ -35,16 +35,23 @@
 %7Bshallow
+, mount
 %7D from '
@@ -259,16 +259,35 @@
 subject.
+find('span').at(0).
 text()).
@@ -364,39 +364,37 @@
   let subject = 
-shallow
+mount
 (%3CDevToolName%3Edo

fix tests