"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _ThumbnailItem = require("../ThumbnailItem");
var _jsxRuntime = require("react/jsx-runtime");
describe('ThumbnailItem Specs', function () {
  var children = 'Main content';
  test('should render a thumbnail item with content', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem.ThumbnailItemBase, {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var actual = _react.screen.getByText(children);
    expect(actual).toHaveTextContent(children);
  });
  test('should render a label when `label` prop is set', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem.ThumbnailItemBase, {
      label: "label",
      src: "https://dummyimage.com/64/e048e0/0011ff"
    }));
    var expected = 'label';
    var actual = _react.screen.getByText('label').parentElement.parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should display an image when given a `src` prop', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem.ThumbnailItemBase, {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var expected = 'thumbnail';
    var actual = _react.screen.getAllByRole('img')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should apply selected style when `selected=true`', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem.ThumbnailItemBase, {
      selected: true,
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var expected = 'selected';
    var actual = _react.screen.getAllByRole('img')[0].parentElement.parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should apply `styled` className when `type=styled`', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem.ThumbnailItemBase, {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      type: "styled",
      children: children
    }));
    var expected = 'styled';
    var actual = _react.screen.getAllByRole('img')[0].parentElement.parentElement;
    expect(actual).toHaveClass(expected);
  });
});