"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _enzyme = require("enzyme");

var _ = _interopRequireDefault(require("."));

describe('Avatar', function () {
  it('displays Avatar', function () {
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], null, "OB"));
    expect(node.hasClass('Avatar')).toBe(true);
  });
  it('displays emoji Avatar', function () {
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], null, /*#__PURE__*/_react["default"].createElement("span", {
      "aria-label": "Owl",
      role: "img"
    }, "\uD83E\uDD89")));
    expect(node.hasClass('Avatar_emoji')).toBe(true);
  });
  it('displays circular Avatar', function () {
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      circular: true
    }, "OB"));
    expect(node.hasClass('Avatar_circular')).toBe(true);
  });
  it('displays Avatar with custom bg color', function () {
    var color = '#000';
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      hexColor: color
    }, "OB"));
    expect(node.find('.Avatar').get(0).props.style.background).toBe(color);
  });
  it('displays Avatar with image', function () {
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      imgSrc: "//fakeUrl.png"
    }));
    expect(node.find('img')).toHaveLength(1);
  });
  it('displays large Avatar', function () {
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      size: "lg"
    }, "OB"));
    expect(node.hasClass('Avatar_lg')).toBe(true);
  });
});