"use strict";

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

var _enzyme = require("enzyme");

var _Button = _interopRequireDefault(require("../../Button"));

var _TabGroup = _interopRequireDefault(require("../TabGroup"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

describe('TabGroup Specs', function () {
  test('should render three tabs when given three objects in `tabs` prop', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabGroup["default"], {
      tabPosition: "before",
      tabs: [{
        title: 'Home',
        icon: 'home'
      }, {
        title: 'Settings',
        icon: 'setting'
      }, {
        title: 'Theme',
        icon: 'display'
      }]
    }));
    var expected = 3;
    var actual = subject.find('Tab').length;
    expect(actual).toBe(expected);
  });
  test('should have positionAfter when given `tabPosition=after`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabGroup["default"], {
      tabPosition: "after",
      tabs: [{
        title: 'Home',
        icon: 'home'
      }, {
        title: 'Settings',
        icon: 'setting'
      }, {
        title: 'Theme',
        icon: 'display'
      }]
    }));
    var expected = 'after';
    var actual = subject.find('TabGroup').prop('tabPosition');
    expect(actual).toBe(expected);
  });
  test('should render two buttons when given children', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TabGroup["default"], {
      tabPosition: "before",
      tabs: [{
        title: 'Home',
        icon: 'home'
      }, {
        title: 'Settings',
        icon: 'setting'
      }, {
        title: 'Theme',
        icon: 'display'
      }],
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("beforeTabs", {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
          icon: "arrowlargeleft",
          size: "small",
          type: "grid"
        })
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("afterTabs", {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
          icon: "arrowlargeright",
          size: "small",
          type: "grid"
        })
      })]
    }));
    var expected = 'arrowlargeleft';
    var actual = subject.find('Button').at(0).prop('icon');
    expect(actual).toBe(expected);
    var secondExpected = 'arrowlargeright';
    var secondActual = subject.find('Button').at(1).prop('icon');
    expect(secondActual).toBe(secondExpected);
  });
  test('should apply `vertical` when `orientation=vertical`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabGroup["default"], {
      orientation: "vertical",
      tabPosition: "before",
      tabs: [{
        title: 'Home',
        icon: 'home'
      }, {
        title: 'Settings',
        icon: 'setting'
      }, {
        title: 'Theme',
        icon: 'display'
      }]
    }));
    var expected = 'vertical';
    var actual = subject.find('TabGroup').prop('orientation');
    expect(actual).toBe(expected);
  });
});