import React from 'react';
import { shallow } from 'enzyme';
import BoxToolButton from './BoxToolButton';
import DirectChatToggleContactsButton from './DirectChatToggleContactsButton';

test('DirectChatToggleContactsButton notifies DirectChat when clicked', () => {
  let received = false;

  const wrapper = shallow(
    <DirectChatToggleContactsButton />,
    {
      context: {
        $adminlte_directchat: {
          toggleContacts: () => { received = true; },
        },
      },
    },
  );

  wrapper.find(BoxToolButton).simulate('click');
  expect(received).toEqual(true);
});

Test direct chat toggle button click
Test direct chat toggle button click
