"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _Checkbox = require("../Checkbox");
var _jsxRuntime = require("react/jsx-runtime");
describe('Checkbox Specs', function () {
  test('should render correct icon when not selected', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.Checkbox, {}));
    var checkbox = _react.screen.getByRole('checkbox');
    var expected = '✓';
    expect(checkbox).toHaveTextContent(expected);
  });
  test('should render correct icon when selected', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.Checkbox, {
      selected: true
    }));
    var checkbox = _react.screen.getByRole('checkbox');
    var expected = '✓';
    expect(checkbox).toHaveTextContent(expected);
  });
  test('should not include the indeterminate class when not indeterminate', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.CheckboxBase, {}));
    var checkbox = _react.screen.getByRole('checkbox');
    var notExpected = 'indeterminate';
    expect(checkbox).not.toHaveClass(notExpected);
  });
  test('should add the indeterminate class when given the indeterminate prop', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.CheckboxBase, {
      indeterminate: true
    }));
    var checkbox = _react.screen.getByRole('checkbox');
    var expected = 'indeterminate';
    expect(checkbox).toHaveClass(expected);
  });
  test('should prioritize indeterminate over selected', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.CheckboxBase, {
      indeterminate: true,
      indeterminateIcon: "minus",
      selected: true,
      children: "Sel"
    }));
    var checkbox = _react.screen.getByRole('checkbox');
    var expected = '-';
    expect(checkbox).toHaveTextContent(expected);
  });
});