"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _react = _interopRequireDefault(require("react"));
var _react2 = require("../../utils/test-utils/react");
var _react3 = require("@testing-library/react");
var _Thumbnail = _interopRequireDefault(require("../Thumbnail"));
var _ThumbnailPrivateUni = require("../Thumbnail.private.uni.driver");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Thumbnail/test/Thumbnail.spec.jsx",
  _this = void 0;
var render = (0, _react2.createRendererWithUniDriver)(_ThumbnailPrivateUni.thumbnailPrivateDriverFactory);
describe('Thumbnail', function () {
  it('should allow adding title', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
    var title, _render, driver;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          title = 'I am a title';
          _render = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
            title: title,
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 13,
              columnNumber: 31
            }
          })), driver = _render.driver;
          _context.t0 = expect;
          _context.next = 5;
          return driver.getTitle();
        case 5:
          _context.t1 = _context.sent;
          (0, _context.t0)(_context.t1).toEqual(title);
        case 7:
        case "end":
          return _context.stop();
      }
    }, _callee);
  })));
  it('should allow adding description', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
    var description, _render2, driver;
    return _regenerator["default"].wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          description = 'I am a description';
          _render2 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
            description: description,
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 19,
              columnNumber: 31
            }
          })), driver = _render2.driver;
          _context2.t0 = expect;
          _context2.next = 5;
          return driver.getDescription();
        case 5:
          _context2.t1 = _context2.sent;
          (0, _context2.t0)(_context2.t1).toEqual(description);
        case 7:
        case "end":
          return _context2.stop();
      }
    }, _callee2);
  })));
  it('should be clickable', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
    var onClick, _render3, driver;
    return _regenerator["default"].wrap(function _callee3$(_context3) {
      while (1) switch (_context3.prev = _context3.next) {
        case 0:
          onClick = vi.fn();
          _render3 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
            onClick: onClick,
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 25,
              columnNumber: 31
            }
          })), driver = _render3.driver;
          _context3.next = 4;
          return driver.click();
        case 4:
          expect(onClick).toHaveBeenCalled();
        case 5:
        case "end":
          return _context3.stop();
      }
    }, _callee3);
  })));
  it('should be hoverable', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
    var onMouseOver, _render4, driver;
    return _regenerator["default"].wrap(function _callee4$(_context4) {
      while (1) switch (_context4.prev = _context4.next) {
        case 0:
          onMouseOver = vi.fn();
          _render4 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
            onMouseOver: onMouseOver,
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 32,
              columnNumber: 31
            }
          })), driver = _render4.driver;
          _context4.next = 4;
          return driver.mouseOver();
        case 4:
          expect(onMouseOver).toHaveBeenCalled();
        case 5:
        case "end":
          return _context4.stop();
      }
    }, _callee4);
  })));
  describe('focus functionality', function () {
    it('should focus the thumbnail when focus method is called via ref', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
      var ref, _render5, driver;
      return _regenerator["default"].wrap(function _callee6$(_context6) {
        while (1) switch (_context6.prev = _context6.next) {
          case 0:
            ref = /*#__PURE__*/_react["default"].createRef();
            _render5 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              ref: ref,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 40,
                columnNumber: 33
              }
            })), driver = _render5.driver;
            _context6.t0 = expect;
            _context6.next = 5;
            return driver.isFocused();
          case 5:
            _context6.t1 = _context6.sent;
            (0, _context6.t0)(_context6.t1).toBe(false);
            _context6.next = 9;
            return (0, _react3.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
              return _regenerator["default"].wrap(function _callee5$(_context5) {
                while (1) switch (_context5.prev = _context5.next) {
                  case 0:
                    ref.current.focus();
                  case 1:
                  case "end":
                    return _context5.stop();
                }
              }, _callee5);
            })));
          case 9:
            _context6.t2 = expect;
            _context6.next = 12;
            return driver.isFocused();
          case 12:
            _context6.t3 = _context6.sent;
            (0, _context6.t2)(_context6.t3).toBe(true);
          case 14:
          case "end":
            return _context6.stop();
        }
      }, _callee6);
    })));
    it('should not focus when disabled', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8() {
      var ref, _render6, driver;
      return _regenerator["default"].wrap(function _callee8$(_context8) {
        while (1) switch (_context8.prev = _context8.next) {
          case 0:
            ref = /*#__PURE__*/_react["default"].createRef();
            _render6 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              ref: ref,
              disabled: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 53,
                columnNumber: 33
              }
            })), driver = _render6.driver;
            _context8.next = 4;
            return (0, _react3.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
              return _regenerator["default"].wrap(function _callee7$(_context7) {
                while (1) switch (_context7.prev = _context7.next) {
                  case 0:
                    ref.current.focus();
                  case 1:
                  case "end":
                    return _context7.stop();
                }
              }, _callee7);
            })));
          case 4:
            _context8.t0 = expect;
            _context8.next = 7;
            return driver.isFocused();
          case 7:
            _context8.t1 = _context8.sent;
            (0, _context8.t0)(_context8.t1).toBe(false);
          case 9:
          case "end":
            return _context8.stop();
        }
      }, _callee8);
    })));
    it('should call onFocus when focused via ref', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0() {
      var onFocus, ref, _render7, driver;
      return _regenerator["default"].wrap(function _callee0$(_context0) {
        while (1) switch (_context0.prev = _context0.next) {
          case 0:
            onFocus = vi.fn();
            ref = /*#__PURE__*/_react["default"].createRef();
            _render7 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              ref: ref,
              onFocus: onFocus,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 65,
                columnNumber: 33
              }
            })), driver = _render7.driver;
            _context0.next = 5;
            return (0, _react3.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9() {
              return _regenerator["default"].wrap(function _callee9$(_context9) {
                while (1) switch (_context9.prev = _context9.next) {
                  case 0:
                    ref.current.focus();
                  case 1:
                  case "end":
                    return _context9.stop();
                }
              }, _callee9);
            })));
          case 5:
            _context0.t0 = expect;
            _context0.next = 8;
            return driver.isFocused();
          case 8:
            _context0.t1 = _context0.sent;
            (0, _context0.t0)(_context0.t1).toBe(true);
            expect(onFocus).toHaveBeenCalled();
          case 11:
          case "end":
            return _context0.stop();
        }
      }, _callee0);
    })));
  });
  describe('keyboard events', function () {
    it('should invoke onClick for spacebar and enter', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1() {
      var onClick, _render8, driver;
      return _regenerator["default"].wrap(function _callee1$(_context1) {
        while (1) switch (_context1.prev = _context1.next) {
          case 0:
            onClick = vi.fn();
            _render8 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              onClick: onClick,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 79,
                columnNumber: 33
              }
            })), driver = _render8.driver;
            _context1.next = 4;
            return driver.keyDown(' ');
          case 4:
            _context1.next = 6;
            return driver.keyDown('Enter');
          case 6:
            expect(onClick.mock.calls.length).toEqual(2);
          case 7:
          case "end":
            return _context1.stop();
        }
      }, _callee1);
    })));
    it('should not throw error for enter if no prop is provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10() {
      var _render9, driver;
      return _regenerator["default"].wrap(function _callee10$(_context10) {
        while (1) switch (_context10.prev = _context10.next) {
          case 0:
            _render9 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 86,
                columnNumber: 33
              }
            })), driver = _render9.driver;
            _context10.next = 3;
            return expect(driver.keyDown('Enter')).resolves.not.toThrow();
          case 3:
          case "end":
            return _context10.stop();
        }
      }, _callee10);
    })));
  });
  describe('`image` prop', function () {
    describe('as string', function () {
      it('should use string as <img/> src', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11() {
        var src, _render0, driver;
        return _regenerator["default"].wrap(function _callee11$(_context11) {
          while (1) switch (_context11.prev = _context11.next) {
            case 0:
              src = 'john.jpg';
              _render0 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
                image: src,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 95,
                  columnNumber: 35
                }
              })), driver = _render0.driver;
              _context11.t0 = expect;
              _context11.next = 5;
              return driver.getImage().$('img').attr('src');
            case 5:
              _context11.t1 = _context11.sent;
              (0, _context11.t0)(_context11.t1).toEqual(src);
            case 7:
            case "end":
              return _context11.stop();
          }
        }, _callee11);
      })));
    });
    describe('as node', function () {
      it('should render that node as is', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12() {
        var image, _render1, driver;
        return _regenerator["default"].wrap(function _callee12$(_context12) {
          while (1) switch (_context12.prev = _context12.next) {
            case 0:
              image = /*#__PURE__*/_react["default"].createElement("div", {
                "data-hook": "image-node",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 102,
                  columnNumber: 23
                }
              }, "catch me");
              _render1 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
                image: image,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 103,
                  columnNumber: 35
                }
              })), driver = _render1.driver;
              _context12.t0 = expect;
              _context12.next = 5;
              return driver.getImage().$('[data-hook="image-node"]').text();
            case 5:
              _context12.t1 = _context12.sent;
              (0, _context12.t0)(_context12.t1).toEqual('catch me');
            case 7:
            case "end":
              return _context12.stop();
          }
        }, _callee12);
      })));
    });
  });
  describe('`backgroundImage` prop', function () {
    it('should allow adding backgroundImage as URL', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13() {
      var _render10, driver;
      return _regenerator["default"].wrap(function _callee13$(_context13) {
        while (1) switch (_context13.prev = _context13.next) {
          case 0:
            _render10 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              image: "image.jpg",
              backgroundImage: "john.jpg",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 114,
                columnNumber: 9
              }
            })), driver = _render10.driver;
            _context13.t0 = expect;
            _context13.next = 4;
            return driver.getBackgroundImage().attr('style');
          case 4:
            _context13.t1 = _context13.sent;
            (0, _context13.t0)(_context13.t1).toEqual('background-image: url("john.jpg");');
          case 6:
          case "end":
            return _context13.stop();
        }
      }, _callee13);
    })));
    it('should disable title (inside thumbnail wrapper), description and image', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14() {
      var _render11, driver;
      return _regenerator["default"].wrap(function _callee14$(_context14) {
        while (1) switch (_context14.prev = _context14.next) {
          case 0:
            _render11 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              image: "image.jpg",
              backgroundImage: "john.jpg",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 128,
                columnNumber: 9
              }
            })), driver = _render11.driver;
            _context14.t0 = expect;
            _context14.next = 4;
            return driver.titleExists();
          case 4:
            _context14.t1 = _context14.sent;
            (0, _context14.t0)(_context14.t1).toEqual(false);
            _context14.t2 = expect;
            _context14.next = 9;
            return driver.descriptionExists();
          case 9:
            _context14.t3 = _context14.sent;
            (0, _context14.t2)(_context14.t3).toEqual(false);
            _context14.t4 = expect;
            _context14.next = 14;
            return driver.imageExists();
          case 14:
            _context14.t5 = _context14.sent;
            (0, _context14.t4)(_context14.t5).toEqual(false);
          case 16:
          case "end":
            return _context14.stop();
        }
      }, _callee14);
    })));
    it('should display bottom title', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
      var _render12, driver;
      return _regenerator["default"].wrap(function _callee15$(_context15) {
        while (1) switch (_context15.prev = _context15.next) {
          case 0:
            _render12 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              image: "image.jpg",
              backgroundImage: "john.jpg",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 142,
                columnNumber: 9
              }
            })), driver = _render12.driver;
            _context15.t0 = expect;
            _context15.next = 4;
            return driver.titleExists();
          case 4:
            _context15.t1 = _context15.sent;
            (0, _context15.t0)(_context15.t1).toEqual(false);
            _context15.t2 = expect;
            _context15.next = 9;
            return driver.descriptionExists();
          case 9:
            _context15.t3 = _context15.sent;
            (0, _context15.t2)(_context15.t3).toEqual(false);
            _context15.t4 = expect;
            _context15.next = 14;
            return driver.imageExists();
          case 14:
            _context15.t5 = _context15.sent;
            (0, _context15.t4)(_context15.t5).toEqual(false);
            _context15.t6 = expect;
            _context15.next = 19;
            return driver.bottomTitleExists();
          case 19:
            _context15.t7 = _context15.sent;
            (0, _context15.t6)(_context15.t7).toEqual(true);
            _context15.t8 = expect;
            _context15.next = 24;
            return driver.getTitle();
          case 24:
            _context15.t9 = _context15.sent;
            (0, _context15.t8)(_context15.t9).toEqual('title');
          case 26:
          case "end":
            return _context15.stop();
        }
      }, _callee15);
    })));
    it('should not display bottom title when no `backgroundImage` provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
      var _render13, driver;
      return _regenerator["default"].wrap(function _callee16$(_context16) {
        while (1) switch (_context16.prev = _context16.next) {
          case 0:
            _render13 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 158,
                columnNumber: 9
              }
            })), driver = _render13.driver;
            _context16.t0 = expect;
            _context16.next = 4;
            return driver.titleExists();
          case 4:
            _context16.t1 = _context16.sent;
            (0, _context16.t0)(_context16.t1).toEqual(true);
            _context16.t2 = expect;
            _context16.next = 9;
            return driver.descriptionExists();
          case 9:
            _context16.t3 = _context16.sent;
            (0, _context16.t2)(_context16.t3).toEqual(true);
            _context16.t4 = expect;
            _context16.next = 14;
            return driver.bottomTitleExists();
          case 14:
            _context16.t5 = _context16.sent;
            (0, _context16.t4)(_context16.t5).toEqual(false);
          case 16:
          case "end":
            return _context16.stop();
        }
      }, _callee16);
    })));
  });
  describe('`selected` prop', function () {
    it('should render icon when true', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17() {
      var _render14, driver;
      return _regenerator["default"].wrap(function _callee17$(_context17) {
        while (1) switch (_context17.prev = _context17.next) {
          case 0:
            _render14 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              selected: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 168,
                columnNumber: 33
              }
            })), driver = _render14.driver;
            _context17.t0 = expect;
            _context17.next = 4;
            return driver.selectedIconExists();
          case 4:
            _context17.t1 = _context17.sent;
            (0, _context17.t0)(_context17.t1).toEqual(true);
            _context17.t2 = expect;
            _context17.next = 9;
            return driver.isSelected();
          case 9:
            _context17.t3 = _context17.sent;
            (0, _context17.t2)(_context17.t3).toEqual(true);
          case 11:
          case "end":
            return _context17.stop();
        }
      }, _callee17);
    })));
    it('should not render icon when false', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18() {
      var _render15, driver;
      return _regenerator["default"].wrap(function _callee18$(_context18) {
        while (1) switch (_context18.prev = _context18.next) {
          case 0:
            _render15 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              selected: true,
              hideSelectedIcon: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 174,
                columnNumber: 33
              }
            })), driver = _render15.driver;
            _context18.t0 = expect;
            _context18.next = 4;
            return driver.getSelectedIcon().exists();
          case 4:
            _context18.t1 = _context18.sent;
            (0, _context18.t0)(_context18.t1).toEqual(false);
          case 6:
          case "end":
            return _context18.stop();
        }
      }, _callee18);
    })));
  });
  describe('`disabled` prop', function () {
    it('should have disabled state', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19() {
      var _render16, driver;
      return _regenerator["default"].wrap(function _callee19$(_context19) {
        while (1) switch (_context19.prev = _context19.next) {
          case 0:
            _render16 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              disabled: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 181,
                columnNumber: 33
              }
            })), driver = _render16.driver;
            _context19.t0 = expect;
            _context19.next = 4;
            return driver.isDisabled();
          case 4:
            _context19.t1 = _context19.sent;
            (0, _context19.t0)(_context19.t1).toEqual(true);
          case 6:
          case "end":
            return _context19.stop();
        }
      }, _callee19);
    })));
    it('should not trigger onClick', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee20() {
      var onClick, _render17, driver;
      return _regenerator["default"].wrap(function _callee20$(_context20) {
        while (1) switch (_context20.prev = _context20.next) {
          case 0:
            onClick = vi.fn();
            _render17 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              disabled: true,
              onClick: onClick,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 187,
                columnNumber: 33
              }
            })), driver = _render17.driver;
            _context20.next = 4;
            return driver.click();
          case 4:
            expect(onClick).not.toHaveBeenCalled();
          case 5:
          case "end":
            return _context20.stop();
        }
      }, _callee20);
    })));
    it('should not trigger onMouseOver', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee21() {
      var onMouseOver, _render18, driver;
      return _regenerator["default"].wrap(function _callee21$(_context21) {
        while (1) switch (_context21.prev = _context21.next) {
          case 0:
            onMouseOver = vi.fn();
            _render18 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              disabled: true,
              onMouseOver: onMouseOver,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 195,
                columnNumber: 9
              }
            })), driver = _render18.driver;
            _context21.next = 4;
            return driver.mouseOver();
          case 4:
            expect(onMouseOver).not.toHaveBeenCalled();
          case 5:
          case "end":
            return _context21.stop();
        }
      }, _callee21);
    })));
  });
  describe('`width` & `height` props', function () {
    it('should set width & height', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee22() {
      var _render19, driver;
      return _regenerator["default"].wrap(function _callee22$(_context22) {
        while (1) switch (_context22.prev = _context22.next) {
          case 0:
            _render19 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              width: 100,
              height: 100,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 204,
                columnNumber: 33
              }
            })), driver = _render19.driver;
            _context22.t0 = expect;
            _context22.next = 4;
            return driver.getWidth();
          case 4:
            _context22.t1 = _context22.sent;
            (0, _context22.t0)(_context22.t1).toEqual('100px');
            _context22.t2 = expect;
            _context22.next = 9;
            return driver.getHeight();
          case 9:
            _context22.t3 = _context22.sent;
            (0, _context22.t2)(_context22.t3).toEqual('100px');
          case 11:
          case "end":
            return _context22.stop();
        }
      }, _callee22);
    })));
  });
  describe('children', function () {
    it('should render children', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee23() {
      var _render20, driver;
      return _regenerator["default"].wrap(function _callee23$(_context23) {
        while (1) switch (_context23.prev = _context23.next) {
          case 0:
            _render20 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 213,
                columnNumber: 9
              }
            }, /*#__PURE__*/_react["default"].createElement("div", {
              "data-hook": "custom-child",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 214,
                columnNumber: 11
              }
            }))), driver = _render20.driver;
            _context23.t0 = expect;
            _context23.next = 4;
            return driver.customChildExists();
          case 4:
            _context23.t1 = _context23.sent;
            (0, _context23.t0)(_context23.t1).toEqual(true);
          case 6:
          case "end":
            return _context23.stop();
        }
      }, _callee23);
    })));
    it('should hide title (inside thumbnail wrapper), description and image', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee24() {
      var _render21, driver;
      return _regenerator["default"].wrap(function _callee24$(_context24) {
        while (1) switch (_context24.prev = _context24.next) {
          case 0:
            _render21 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              image: "image.jpg",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 222,
                columnNumber: 9
              }
            }, /*#__PURE__*/_react["default"].createElement("div", {
              "data-hook": "custom-child",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 223,
                columnNumber: 11
              }
            }))), driver = _render21.driver;
            _context24.t0 = expect;
            _context24.next = 4;
            return driver.titleExists();
          case 4:
            _context24.t1 = _context24.sent;
            (0, _context24.t0)(_context24.t1).toEqual(false);
            _context24.t2 = expect;
            _context24.next = 9;
            return driver.descriptionExists();
          case 9:
            _context24.t3 = _context24.sent;
            (0, _context24.t2)(_context24.t3).toEqual(false);
            _context24.t4 = expect;
            _context24.next = 14;
            return driver.imageExists();
          case 14:
            _context24.t5 = _context24.sent;
            (0, _context24.t4)(_context24.t5).toEqual(false);
          case 16:
          case "end":
            return _context24.stop();
        }
      }, _callee24);
    })));
    it('should display bottom title', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee25() {
      var _render22, driver;
      return _regenerator["default"].wrap(function _callee25$(_context25) {
        while (1) switch (_context25.prev = _context25.next) {
          case 0:
            _render22 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              title: "title",
              description: "description",
              image: "image.jpg",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 233,
                columnNumber: 9
              }
            }, /*#__PURE__*/_react["default"].createElement("div", {
              "data-hook": "custom-child",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 234,
                columnNumber: 11
              }
            }))), driver = _render22.driver;
            _context25.t0 = expect;
            _context25.next = 4;
            return driver.titleExists();
          case 4:
            _context25.t1 = _context25.sent;
            (0, _context25.t0)(_context25.t1).toEqual(false);
            _context25.t2 = expect;
            _context25.next = 9;
            return driver.descriptionExists();
          case 9:
            _context25.t3 = _context25.sent;
            (0, _context25.t2)(_context25.t3).toEqual(false);
            _context25.t4 = expect;
            _context25.next = 14;
            return driver.imageExists();
          case 14:
            _context25.t5 = _context25.sent;
            (0, _context25.t4)(_context25.t5).toEqual(false);
            _context25.t6 = expect;
            _context25.next = 19;
            return driver.bottomTitleExists();
          case 19:
            _context25.t7 = _context25.sent;
            (0, _context25.t6)(_context25.t7).toEqual(true);
            _context25.t8 = expect;
            _context25.next = 24;
            return driver.getTitle();
          case 24:
            _context25.t9 = _context25.sent;
            (0, _context25.t8)(_context25.t9).toEqual('title');
          case 26:
          case "end":
            return _context25.stop();
        }
      }, _callee25);
    })));
  });
  describe('`ariaLabel` prop', function () {
    it('should set aria-label when provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee26() {
      var ariaLabel, _render23, driver;
      return _regenerator["default"].wrap(function _callee26$(_context26) {
        while (1) switch (_context26.prev = _context26.next) {
          case 0:
            ariaLabel = 'Custom thumbnail label';
            _render23 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              ariaLabel: ariaLabel,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 248,
                columnNumber: 33
              }
            })), driver = _render23.driver;
            _context26.t0 = expect;
            _context26.next = 5;
            return driver.getAriaLabel();
          case 5:
            _context26.t1 = _context26.sent;
            (0, _context26.t0)(_context26.t1).toEqual(ariaLabel);
          case 7:
          case "end":
            return _context26.stop();
        }
      }, _callee26);
    })));
    it('should not set aria-label when not provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee27() {
      var _render24, driver;
      return _regenerator["default"].wrap(function _callee27$(_context27) {
        while (1) switch (_context27.prev = _context27.next) {
          case 0:
            _render24 = render(/*#__PURE__*/_react["default"].createElement(_Thumbnail["default"], {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 253,
                columnNumber: 33
              }
            })), driver = _render24.driver;
            _context27.t0 = expect;
            _context27.next = 4;
            return driver.getAriaLabel();
          case 4:
            _context27.t1 = _context27.sent;
            (0, _context27.t0)(_context27.t1).toBeNull();
          case 6:
          case "end":
            return _context27.stop();
        }
      }, _callee27);
    })));
  });
});