/*
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 { StatefulPanel, StatefulPanelContainer, Panel } from '../index.js';
describe('StatefulPanel', function () {
  test('basic render', function () {
    function PanelContainer() {
      return React.createElement("div", null);
    }

    var props = {
      overrides: {
        PanelContainer: PanelContainer
      },
      onChange: jest.fn(),
      stateReducer: jest.fn(),
      children: 'Content'
    };
    var component = mount(React.createElement(StatefulPanel, props));
    var renderedPanel = component.find(Panel);
    expect(component.find(StatefulPanelContainer).length).toBe(1);
    expect(renderedPanel.length).toBe(1);
    expect(renderedPanel.first().props().overrides).toEqual(props.overrides);
    expect(renderedPanel.first().props().children).toEqual(props.children);
  });
});