"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _Item = require("../Item");
var _jsxRuntime = require("react/jsx-runtime");
describe('Item Specs', function () {
  test('should render an Item with content', function () {
    var expected = 'Hello Item';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      children: expected
    }));
    var actual = _react.screen.getByText(expected);
    expect(actual).toHaveTextContent(expected);
  });
  test('should support adding a `label`', function () {
    var expected = 'Example Label';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      label: expected,
      children: "Hello Item"
    }));
    var label = _react.screen.getByText('Hello Item');
    expect(label).toBeInTheDocument();
  });
  test('should support label with 0', function () {
    var expected = '0';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      label: expected,
      children: "Hello Item"
    }));
    var label = _react.screen.getByText(expected);
    expect(label).toBeInTheDocument();
  });
  test('should support adding text as a child when a label is also set', function () {
    var expected = 'Hello Item';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      label: "Example Label",
      children: expected
    }));
    var actual = _react.screen.getByText(expected);
    expect(actual).toBeInTheDocument();
  });
  test('should support `slotBefore`', function () {
    var expected = 'slot before';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      slotBefore: expected,
      children: "Hello Item"
    }));
    var actual = _react.screen.getByText(expected);
    expect(actual).toBeInTheDocument();
  });
  test('should support `slotAfter`', function () {
    var expected = 'slot after';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      slotAfter: expected,
      children: "Hello Item"
    }));
    var actual = _react.screen.getByText(expected);
    expect(actual).toBeInTheDocument();
  });
  test('should support repositioning of the label', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      "data-testid": "item",
      label: "my label",
      labelPosition: "above",
      children: "Hello Item"
    }));
    var expected = 'labelAbove';
    var actual = _react.screen.getByTestId('item').children[0];
    expect(actual).toHaveClass(expected);
  });
  test('should not include the selected class when not selected', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      "data-testid": "item",
      children: "Hello Item"
    }));
    var expected = 'selected';
    var actual = _react.screen.getByTestId('item');
    expect(actual).not.toHaveClass(expected);
  });
  test('should add the selected class when given the selected prop', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      "data-testid": "item",
      selected: true,
      children: "Hello Item"
    }));
    var expected = 'selected';
    var actual = _react.screen.getByTestId('item');
    expect(actual).toHaveClass(expected);
  });
  test('should apply small class when size prop is `small`', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      "data-testid": "item",
      size: "small"
    }));
    var expected = 'small';
    var actual = _react.screen.getByTestId('item');
    expect(actual).toHaveClass(expected);
  });
  test('should apply large class by default', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      "data-testid": "item"
    }));
    var expected = 'large';
    var actual = _react.screen.getByTestId('item');
    expect(actual).toHaveClass(expected);
  });
  test('should apply centered class when centered prop is true', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      centered: true,
      "data-testid": "item"
    }));
    var expected = 'centered';
    var actual = _react.screen.getByTestId('item');
    expect(actual).toHaveClass(expected);
  });
  test('should support RTL text', function () {
    var text = 'Hello מצב תמונה';
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item.ItemBase, {
      children: text
    }));
    var expected = 'rtl';
    var actual = _react.screen.getByText(text).style;
    expect(actual).toHaveProperty('direction', expected);
  });
});