/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { mount } from 'enzyme';
import MaybeChildMenu from '../maybe-child-menu.js';
describe('MaybeChildMenu', function () {
  it('does not render popover if getChildMenu is undefined', function () {
    var wrapper = mount(React.createElement(MaybeChildMenu, {
      getChildMenu: null,
      item: {
        label: 'item'
      }
    }, React.createElement("div", null, "child")));
    expect(wrapper.children().first().name()).toBe('div');
  });
  it('renders popover if getChildMenu is provided', function () {
    var wrapper = mount(React.createElement(MaybeChildMenu, {
      getChildMenu: function getChildMenu() {
        return React.createElement("button", null, "child menu");
      },
      item: {
        label: 'item'
      }
    }, React.createElement("div", null, "child")));
    expect(wrapper.children().first().name()).toBe('StatefulPopover');
  });
});