"use strict";

var _jsxRuntime = require("react/jsx-runtime");

var _enzyme = require("enzyme");

var _PopupMenu = require("../PopupMenu");

describe('PopupMenu specs', function () {
  test('should be rendered opened if open is set to true', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenu, {
      open: true,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        children: "popupMenu"
      })
    }));
    var expected = true;
    var actual = popupMenu.prop('open');
    expect(actual).toBe(expected);
  });
  test('should not be rendered if open is set to false', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenu, {
      open: false,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        children: "popupMenu"
      })
    }));
    var expected = false;
    var actual = popupMenu.prop('open');
    expect(actual).toBe(expected);
  });
  test('should display correct title', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenu, {
      title: "This is a Popupmenu title"
    }));
    var expected = 'This is a Popupmenu title';
    var actual = popupMenu.prop('title');
    expect(actual).toBe(expected);
  });
  test('should apply \'shown\' class when visible with noAnimation', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenuBase, {
      noAnimation: true,
      open: true
    }));
    var expected = 'shown';
    var actual = popupMenu.find('div').at(0).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply \'ease-in-out\' class when noAnimation is false', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenuBase, {
      open: true,
      noAnimation: false
    }));
    var expected = 'ease-in-out';
    var actual = popupMenu.find('div').at(0).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have orientation=horizontal when no orientation is specified', function () {
    var popupMenu = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopupMenu.PopupMenuBase, {}));
    var expected = 'horizontal';
    var actual = popupMenu.prop('orientation');
    expect(actual).toBe(expected);
  });
});