{"size": 1685, "ext": "js", "max_stars_repo_path": "node_modules/carbon-components-react/lib/components/SelectItemGroup/SelectItemGroup-test.js", "max_stars_repo_name": "harzulu65/haroldzuluagaus", "max_stars_repo_stars_event_min_datetime": "2021-03-07T18:54:34.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-25T01:48:04.000Z", "max_issues_repo_path": "node_modules/carbon-components-react/lib/components/SelectItemGroup/SelectItemGroup-test.js", "max_issues_repo_name": "harzulu65/haroldzuluagaus", "max_issues_repo_issues_event_min_datetime": "2020-08-06T07:09:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T07:48:19.000Z", "max_forks_repo_path": "node_modules/carbon-components-react/lib/components/SelectItemGroup/SelectItemGroup-test.js", "max_forks_repo_name": "harzulu65/haroldzuluagaus", "max_forks_repo_forks_event_min_datetime": "2020-07-05T11:37:18.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-05T12:09:11.000Z"}
{"max_stars_count": 11, "max_issues_count": 4, "max_forks_count": 7, "avg_line_length": 34.387755102, "max_line_length": 109, "alphanum_fraction": 0.6629080119}
"use strict";

var _react = _interopRequireDefault(require("react"));

var _SelectItemGroup = _interopRequireDefault(require("../SelectItemGroup"));

var _enzyme = require("enzyme");

var _carbonComponents = require("carbon-components");

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

/**
 * Copyright IBM Corp. 2016, 2018
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */
var prefix = _carbonComponents.settings.prefix;
describe('SelectItemGroup', function () {
  describe('Renders as expected', function () {
    var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_SelectItemGroup.default, {
      className: "extra-class",
      label: "test"
    }));
    it('should have the expected classes', function () {
      expect(wrapper.hasClass("".concat(prefix, "--select-optgroup"))).toEqual(true);
    });
    it('Should add extra classes that are passed via className', function () {
      expect(wrapper.hasClass('extra-class')).toEqual(true);
    });
    it('Should add the label that is passed', function () {
      wrapper.setProps({
        label: 'placeholder-item'
      });
      expect(wrapper.props().label).toEqual('placeholder-item');
    });
    it('Should not be disabled by default', function () {
      expect(wrapper.props().disabled).toEqual(false);
    });
    it('should set disabled as expected', function () {
      expect(wrapper.props().disabled).toEqual(false);
      wrapper.setProps({
        disabled: true
      });
      expect(wrapper.props().disabled).toEqual(true);
    });
  });
});