"use strict";

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

var _enzyme = require("enzyme");

var _ThumbnailItem = _interopRequireDefault(require("../ThumbnailItem"));

var _ThumbnailItemModule = _interopRequireDefault(require("../ThumbnailItem.module.css"));

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

describe('ThumbnailItem Specs', function () {
  test('should render a thumbnail item with content', function () {
    var children = 'Main content';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem["default"], {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var expected = 'Main content';
    var actual = subject.prop('children');
    expect(actual).toBe(expected);
  });
  test('should render a label when `label` prop is set', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem["default"], {
      label: "label",
      src: "https://dummyimage.com/64/e048e0/0011ff"
    }));
    var expected = 'label';
    var actual = subject.prop('label');
    expect(actual).toBe(expected);
  });
  test('should display an image when given a `src` prop', function () {
    var children = 'Main content';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem["default"], {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var expected = 'thumbnail';
    var actual = subject.find(".".concat(_ThumbnailItemModule["default"].thumbnail)).at(1).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply selected style when `selected=true`', function () {
    var children = 'Main content';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem["default"], {
      selected: true,
      src: "https://dummyimage.com/64/e048e0/0011ff",
      children: children
    }));
    var expected = 'selected';
    var actual = subject.find(".".concat(_ThumbnailItemModule["default"].selected)).at(1).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply `styled` className when `type=styled`', function () {
    var children = 'Main children';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThumbnailItem["default"], {
      src: "https://dummyimage.com/64/e048e0/0011ff",
      type: "styled",
      children: children
    }));
    var expected = 'styled';
    var actual = subject.find(".".concat(_ThumbnailItemModule["default"].styled)).at(1).prop('className');
    expect(actual).toContain(expected);
  });
});