import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _extends from "@babel/runtime/helpers/extends";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/ImageViewer/test/ImageViewer.spec.jsx",
  _this = this;
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import { fireEvent } from '@testing-library/react';
import ImageViewer from '../ImageViewer';
import { imageViewerPrivateDriverFactory } from './ImageViewer.private.uni.driver';
import imageViewerPrivateDriver from './ImageViewer.private.driver';
import { createRendererWithUniDriver, cleanup, act } from '../../utils/test-utils/react';
describe('ImageViewer', function () {
  var imageUrl = 'https://upload.wikimedia.org/wikipedia/commons/d/dd/New_Mela_Ramanputhur_Holy_Family_Church.jpg';
  var secondImageUrl = 'https://onlinepngtools.com/images/examples-onlinepngtools/palm-fronds-and-sky.png';
  var buildComponent = function buildComponent() {
    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    return /*#__PURE__*/React.createElement(ImageViewer, _extends({}, props, {
      __self: _this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 19,
        columnNumber: 42
      }
    }));
  };
  afterEach(function () {
    return cleanup();
  });
  describe('[async]', function () {
    var render = createRendererWithUniDriver(imageViewerPrivateDriverFactory);
    runTests(render);
    describe('More Actions menu', function () {
      describe('Remove button', function () {
        describe('`onRemoveImage` prop', function () {
          it('should call callback [when] clicked on remove button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
            var onRemoveImage, _render, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee$(_context) {
              while (1) switch (_context.prev = _context.next) {
                case 0:
                  onRemoveImage = vi.fn();
                  _render = render(buildComponent({
                    onRemoveImage: onRemoveImage,
                    imageUrl: imageUrl,
                    showRemoveButton: true,
                    showUpdateButton: true,
                    showDownloadButton: true
                  })), driver = _render.driver;
                  _context.t0 = imageViewerPrivateDriver;
                  _context.next = 5;
                  return driver.element();
                case 5:
                  _context.t1 = _context.sent;
                  _context.t2 = fireEvent;
                  _context.t3 = {
                    element: _context.t1,
                    eventTrigger: _context.t2
                  };
                  privateDriver = (0, _context.t0)(_context.t3);
                  _context.next = 11;
                  return privateDriver.simulateImageLoad();
                case 11:
                  _context.next = 13;
                  return driver.clickRemove();
                case 13:
                  expect(onRemoveImage).toHaveBeenCalled();
                case 14:
                case "end":
                  return _context.stop();
              }
            }, _callee);
          })));
        });
      });
    });
    describe('Download button', function () {
      describe('`onDownloadImage` prop', function () {
        it('should call callback [when] clicked on download button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
          var onDownloadImage, _render2, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee2$(_context2) {
            while (1) switch (_context2.prev = _context2.next) {
              case 0:
                onDownloadImage = vi.fn();
                _render2 = render(buildComponent({
                  onDownloadImage: onDownloadImage,
                  imageUrl: imageUrl,
                  showRemoveButton: true,
                  showUpdateButton: true,
                  showDownloadButton: true
                })), driver = _render2.driver;
                _context2.t0 = imageViewerPrivateDriver;
                _context2.next = 5;
                return driver.element();
              case 5:
                _context2.t1 = _context2.sent;
                _context2.t2 = fireEvent;
                _context2.t3 = {
                  element: _context2.t1,
                  eventTrigger: _context2.t2
                };
                privateDriver = (0, _context2.t0)(_context2.t3);
                _context2.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context2.next = 13;
                return driver.clickDownload();
              case 13:
                expect(onDownloadImage).toHaveBeenCalled();
              case 14:
              case "end":
                return _context2.stop();
            }
          }, _callee2);
        })));
      });
    });
    describe('ref api', function () {
      describe('`focus` method', function () {
        it('should focus on addItem when there is no image', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
          var _ref4, _render3, driver;
          return _regeneratorRuntime.wrap(function _callee4$(_context4) {
            while (1) switch (_context4.prev = _context4.next) {
              case 0:
                _render3 = render(buildComponent({
                  ref: function ref(el) {
                    return _ref4 = el;
                  }
                })), driver = _render3.driver;
                _context4.t0 = expect;
                _context4.next = 4;
                return driver.isAddItemVisible();
              case 4:
                _context4.t1 = _context4.sent;
                (0, _context4.t0)(_context4.t1).toBe(true);
                _context4.next = 8;
                return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
                  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
                    while (1) switch (_context3.prev = _context3.next) {
                      case 0:
                        _ref4.focus();
                      case 1:
                      case "end":
                        return _context3.stop();
                    }
                  }, _callee3);
                })));
              case 8:
                _context4.t2 = expect;
                _context4.next = 11;
                return driver.isAddItemFocused();
              case 11:
                _context4.t3 = _context4.sent;
                (0, _context4.t2)(_context4.t3).toBe(true);
              case 13:
              case "end":
                return _context4.stop();
            }
          }, _callee4);
        })));
        describe('should focus on first button when there is image', function () {
          it('update button is first', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
            var _ref7, _render4, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee6$(_context6) {
              while (1) switch (_context6.prev = _context6.next) {
                case 0:
                  _render4 = render(buildComponent({
                    imageUrl: imageUrl,
                    showUpdateButton: true,
                    showDownloadButton: false,
                    showRemoveButton: true,
                    ref: function ref(el) {
                      return _ref7 = el;
                    }
                  })), driver = _render4.driver;
                  _context6.t0 = imageViewerPrivateDriver;
                  _context6.next = 4;
                  return driver.element();
                case 4:
                  _context6.t1 = _context6.sent;
                  _context6.t2 = fireEvent;
                  _context6.t3 = {
                    element: _context6.t1,
                    eventTrigger: _context6.t2
                  };
                  privateDriver = (0, _context6.t0)(_context6.t3);
                  _context6.next = 10;
                  return privateDriver.simulateImageLoad();
                case 10:
                  _context6.next = 12;
                  return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
                    return _regeneratorRuntime.wrap(function _callee5$(_context5) {
                      while (1) switch (_context5.prev = _context5.next) {
                        case 0:
                          _ref7.focus();
                        case 1:
                        case "end":
                          return _context5.stop();
                      }
                    }, _callee5);
                  })));
                case 12:
                  _context6.t4 = expect;
                  _context6.next = 15;
                  return driver.isUpdateButtonFocused();
                case 15:
                  _context6.t5 = _context6.sent;
                  (0, _context6.t4)(_context6.t5).toBe(true);
                case 17:
                case "end":
                  return _context6.stop();
              }
            }, _callee6);
          })));
          it('remove button is first', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
            var _ref0, _render5, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee8$(_context8) {
              while (1) switch (_context8.prev = _context8.next) {
                case 0:
                  _render5 = render(buildComponent({
                    imageUrl: imageUrl,
                    showUpdateButton: false,
                    showDownloadButton: false,
                    showRemoveButton: true,
                    ref: function ref(el) {
                      return _ref0 = el;
                    }
                  })), driver = _render5.driver;
                  _context8.t0 = imageViewerPrivateDriver;
                  _context8.next = 4;
                  return driver.element();
                case 4:
                  _context8.t1 = _context8.sent;
                  _context8.t2 = fireEvent;
                  _context8.t3 = {
                    element: _context8.t1,
                    eventTrigger: _context8.t2
                  };
                  privateDriver = (0, _context8.t0)(_context8.t3);
                  _context8.next = 10;
                  return privateDriver.simulateImageLoad();
                case 10:
                  _context8.next = 12;
                  return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
                    return _regeneratorRuntime.wrap(function _callee7$(_context7) {
                      while (1) switch (_context7.prev = _context7.next) {
                        case 0:
                          _ref0.focus();
                        case 1:
                        case "end":
                          return _context7.stop();
                      }
                    }, _callee7);
                  })));
                case 12:
                  _context8.t4 = expect;
                  _context8.next = 15;
                  return driver.isRemoveButtonFocused();
                case 15:
                  _context8.t5 = _context8.sent;
                  (0, _context8.t4)(_context8.t5).toBe(true);
                case 17:
                case "end":
                  return _context8.stop();
              }
            }, _callee8);
          })));
          it('download button is first', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
            var _ref11, _render6, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee0$(_context0) {
              while (1) switch (_context0.prev = _context0.next) {
                case 0:
                  _render6 = render(buildComponent({
                    imageUrl: imageUrl,
                    showUpdateButton: false,
                    showDownloadButton: true,
                    showRemoveButton: true,
                    ref: function ref(el) {
                      return _ref11 = el;
                    }
                  })), driver = _render6.driver;
                  _context0.t0 = imageViewerPrivateDriver;
                  _context0.next = 4;
                  return driver.element();
                case 4:
                  _context0.t1 = _context0.sent;
                  _context0.t2 = fireEvent;
                  _context0.t3 = {
                    element: _context0.t1,
                    eventTrigger: _context0.t2
                  };
                  privateDriver = (0, _context0.t0)(_context0.t3);
                  _context0.next = 10;
                  return privateDriver.simulateImageLoad();
                case 10:
                  _context0.next = 12;
                  return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
                    return _regeneratorRuntime.wrap(function _callee9$(_context9) {
                      while (1) switch (_context9.prev = _context9.next) {
                        case 0:
                          _ref11.focus();
                        case 1:
                        case "end":
                          return _context9.stop();
                      }
                    }, _callee9);
                  })));
                case 12:
                  _context0.t4 = expect;
                  _context0.next = 15;
                  return driver.isDownloadButtonFocused();
                case 15:
                  _context0.t5 = _context0.sent;
                  (0, _context0.t4)(_context0.t5).toBe(true);
                case 17:
                case "end":
                  return _context0.stop();
              }
            }, _callee0);
          })));
        });
      });
    });
  });
  function runTests(render) {
    describe('`imageUrl` prop', function () {
      describe('when a value is given on mount', function () {
        it('should render the image with the correct url', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1() {
          var _render7, driver;
          return _regeneratorRuntime.wrap(function _callee1$(_context1) {
            while (1) switch (_context1.prev = _context1.next) {
              case 0:
                _render7 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render7.driver;
                _context1.t0 = expect;
                _context1.next = 4;
                return driver.getImageUrl();
              case 4:
                _context1.t1 = _context1.sent;
                (0, _context1.t0)(_context1.t1).toBe(imageUrl);
              case 6:
              case "end":
                return _context1.stop();
            }
          }, _callee1);
        })));
      });
      describe('when no value is given on mount', function () {
        it('should NOT display the image', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
          var _render8, driver;
          return _regeneratorRuntime.wrap(function _callee10$(_context10) {
            while (1) switch (_context10.prev = _context10.next) {
              case 0:
                _render8 = render(buildComponent({
                  imageUrl: undefined
                })), driver = _render8.driver;
                _context10.t0 = expect;
                _context10.next = 4;
                return driver.isImageVisible();
              case 4:
                _context10.t1 = _context10.sent;
                (0, _context10.t0)(_context10.t1).toBe(false);
                _context10.t2 = expect;
                _context10.next = 9;
                return driver.isPreviousImageVisible();
              case 9:
                _context10.t3 = _context10.sent;
                (0, _context10.t2)(_context10.t3).toBe(false);
              case 11:
              case "end":
                return _context10.stop();
            }
          }, _callee10);
        })));
      });
      describe('when the value changes', function () {
        it('should display the previous image until new one is loaded', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
          var _render9, driver, rerender, setProps, privateDriver;
          return _regeneratorRuntime.wrap(function _callee11$(_context11) {
            while (1) switch (_context11.prev = _context11.next) {
              case 0:
                _render9 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render9.driver, rerender = _render9.rerender;
                setProps = function setProps(props) {
                  return rerender(buildComponent(props));
                }; // TODO: Merge the drivers into one, instead of using them separately with different render methods
                _context11.t0 = imageViewerPrivateDriver;
                _context11.next = 5;
                return driver.element();
              case 5:
                _context11.t1 = _context11.sent;
                _context11.t2 = fireEvent;
                _context11.t3 = {
                  element: _context11.t1,
                  eventTrigger: _context11.t2
                };
                privateDriver = (0, _context11.t0)(_context11.t3);
                _context11.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context11.next = 13;
                return setProps({
                  imageUrl: secondImageUrl
                });
              case 13:
                _context11.t4 = expect;
                _context11.next = 16;
                return driver.getPreviousImageUrl();
              case 16:
                _context11.t5 = _context11.sent;
                (0, _context11.t4)(_context11.t5).toBe(imageUrl);
                _context11.t6 = expect;
                _context11.next = 21;
                return driver.isPreviousImageVisible();
              case 21:
                _context11.t7 = _context11.sent;
                (0, _context11.t6)(_context11.t7).toBe(true);
                _context11.t8 = expect;
                _context11.next = 26;
                return driver.getImageUrl();
              case 26:
                _context11.t9 = _context11.sent;
                (0, _context11.t8)(_context11.t9).toBe(secondImageUrl);
                _context11.t10 = expect;
                _context11.next = 31;
                return driver.isImageVisible();
              case 31:
                _context11.t11 = _context11.sent;
                (0, _context11.t10)(_context11.t11).toBe(false);
                _context11.t12 = expect;
                _context11.next = 36;
                return driver.isImageLoaded();
              case 36:
                _context11.t13 = _context11.sent;
                (0, _context11.t12)(_context11.t13).toBe(false);
              case 38:
              case "end":
                return _context11.stop();
            }
          }, _callee11);
        })));
        it('should display the new image after it loads', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
          var _render0, driver, rerender, setProps, privateDriver;
          return _regeneratorRuntime.wrap(function _callee12$(_context12) {
            while (1) switch (_context12.prev = _context12.next) {
              case 0:
                _render0 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render0.driver, rerender = _render0.rerender;
                setProps = function setProps(props) {
                  return rerender(buildComponent(props));
                };
                _context12.t0 = imageViewerPrivateDriver;
                _context12.next = 5;
                return driver.element();
              case 5:
                _context12.t1 = _context12.sent;
                _context12.t2 = fireEvent;
                _context12.t3 = {
                  element: _context12.t1,
                  eventTrigger: _context12.t2
                };
                privateDriver = (0, _context12.t0)(_context12.t3);
                _context12.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context12.next = 13;
                return setProps({
                  imageUrl: secondImageUrl
                });
              case 13:
                _context12.next = 15;
                return privateDriver.simulateImageLoad();
              case 15:
                _context12.t4 = expect;
                _context12.next = 18;
                return driver.getImageUrl();
              case 18:
                _context12.t5 = _context12.sent;
                (0, _context12.t4)(_context12.t5).toBe(secondImageUrl);
                _context12.t6 = expect;
                _context12.next = 23;
                return driver.isImageVisible();
              case 23:
                _context12.t7 = _context12.sent;
                (0, _context12.t6)(_context12.t7).toBe(true);
                _context12.t8 = expect;
                _context12.next = 28;
                return driver.getPreviousImageUrl();
              case 28:
                _context12.t9 = _context12.sent;
                (0, _context12.t8)(_context12.t9).toBe(imageUrl);
                _context12.t10 = expect;
                _context12.next = 33;
                return driver.isPreviousImageVisible();
              case 33:
                _context12.t11 = _context12.sent;
                (0, _context12.t10)(_context12.t11).toBe(false);
              case 35:
              case "end":
                return _context12.stop();
            }
          }, _callee12);
        })));
      });
    });
    describe('AddItem', function () {
      describe('given imageUrl', function () {
        it('should NOT be visible while image is loading', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
          var _render1, driver;
          return _regeneratorRuntime.wrap(function _callee13$(_context13) {
            while (1) switch (_context13.prev = _context13.next) {
              case 0:
                _render1 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render1.driver;
                _context13.t0 = expect;
                _context13.next = 4;
                return driver.isAddItemVisible();
              case 4:
                _context13.t1 = _context13.sent;
                (0, _context13.t0)(_context13.t1).toBe(false);
                _context13.t2 = expect;
                _context13.next = 9;
                return driver.isImageLoaded();
              case 9:
                _context13.t3 = _context13.sent;
                (0, _context13.t2)(_context13.t3).toBe(false);
              case 11:
              case "end":
                return _context13.stop();
            }
          }, _callee13);
        })));
        it('should NOT be visible after image loaded', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
          var _render10, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee14$(_context14) {
            while (1) switch (_context14.prev = _context14.next) {
              case 0:
                _render10 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render10.driver;
                _context14.t0 = imageViewerPrivateDriver;
                _context14.next = 4;
                return driver.element();
              case 4:
                _context14.t1 = _context14.sent;
                _context14.t2 = fireEvent;
                _context14.t3 = {
                  element: _context14.t1,
                  eventTrigger: _context14.t2
                };
                privateDriver = (0, _context14.t0)(_context14.t3);
                _context14.next = 10;
                return privateDriver.simulateImageLoad();
              case 10:
                _context14.t4 = expect;
                _context14.next = 13;
                return driver.isAddItemVisible();
              case 13:
                _context14.t5 = _context14.sent;
                (0, _context14.t4)(_context14.t5).toEqual(false);
              case 15:
              case "end":
                return _context14.stop();
            }
          }, _callee14);
        })));
        it('should show isImageLoaded as true after image loaded', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
          var _render11, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee15$(_context15) {
            while (1) switch (_context15.prev = _context15.next) {
              case 0:
                _render11 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render11.driver;
                _context15.t0 = imageViewerPrivateDriver;
                _context15.next = 4;
                return driver.element();
              case 4:
                _context15.t1 = _context15.sent;
                _context15.t2 = fireEvent;
                _context15.t3 = {
                  element: _context15.t1,
                  eventTrigger: _context15.t2
                };
                privateDriver = (0, _context15.t0)(_context15.t3);
                _context15.next = 10;
                return privateDriver.simulateImageLoad();
              case 10:
                _context15.t4 = expect;
                _context15.next = 13;
                return driver.isImageLoaded();
              case 13:
                _context15.t5 = _context15.sent;
                (0, _context15.t4)(_context15.t5).toBe(true);
              case 15:
              case "end":
                return _context15.stop();
            }
          }, _callee15);
        })));
        it('should NOT be visible while image is loading and previous image is rendered', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
          var _render12, driver, rerender, setProps, privateDriver;
          return _regeneratorRuntime.wrap(function _callee16$(_context16) {
            while (1) switch (_context16.prev = _context16.next) {
              case 0:
                _render12 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render12.driver, rerender = _render12.rerender;
                setProps = function setProps(props) {
                  return rerender(buildComponent(props));
                };
                _context16.t0 = imageViewerPrivateDriver;
                _context16.next = 5;
                return driver.element();
              case 5:
                _context16.t1 = _context16.sent;
                _context16.t2 = fireEvent;
                _context16.t3 = {
                  element: _context16.t1,
                  eventTrigger: _context16.t2
                };
                privateDriver = (0, _context16.t0)(_context16.t3);
                _context16.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                setProps({
                  imageUrl: secondImageUrl
                });
                _context16.t4 = expect;
                _context16.next = 15;
                return driver.isAddItemVisible();
              case 15:
                _context16.t5 = _context16.sent;
                (0, _context16.t4)(_context16.t5).toEqual(false);
              case 17:
              case "end":
                return _context16.stop();
            }
          }, _callee16);
        })));
      });
      describe('when no imageUrl given', function () {
        it('should be visible', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
          var _render13, driver;
          return _regeneratorRuntime.wrap(function _callee17$(_context17) {
            while (1) switch (_context17.prev = _context17.next) {
              case 0:
                _render13 = render(buildComponent({
                  imageUrl: undefined
                })), driver = _render13.driver;
                _context17.t0 = expect;
                _context17.next = 4;
                return driver.isAddItemVisible();
              case 4:
                _context17.t1 = _context17.sent;
                (0, _context17.t0)(_context17.t1).toBe(true);
              case 6:
              case "end":
                return _context17.stop();
            }
          }, _callee17);
        })));
      });
      it('should show tooltip [when] addImageInfo is given', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
        var addImageInfo, _render14, driver;
        return _regeneratorRuntime.wrap(function _callee18$(_context18) {
          while (1) switch (_context18.prev = _context18.next) {
            case 0:
              addImageInfo = 'add image info';
              _render14 = render(buildComponent({
                imageUrl: '',
                addImageInfo: addImageInfo
              })), driver = _render14.driver;
              _context18.t0 = expect;
              _context18.next = 5;
              return driver.getAddTooltipContent();
            case 5:
              _context18.t1 = _context18.sent;
              (0, _context18.t0)(_context18.t1).toBe(addImageInfo);
            case 7:
            case "end":
              return _context18.stop();
          }
        }, _callee18);
      })));
      describe('`onAddImage` prop', function () {
        it('should trigger add image [when] onAddImage is given', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
          var onAddImage, _render15, driver;
          return _regeneratorRuntime.wrap(function _callee19$(_context19) {
            while (1) switch (_context19.prev = _context19.next) {
              case 0:
                onAddImage = vi.fn();
                _render15 = render(buildComponent({
                  onAddImage: onAddImage
                })), driver = _render15.driver;
                _context19.next = 4;
                return driver.clickAdd();
              case 4:
                expect(onAddImage).toHaveBeenCalled();
              case 5:
              case "end":
                return _context19.stop();
            }
          }, _callee19);
        })));
      });
    });
    describe('Loader', function () {
      describe('given `imageUrl`', function () {
        it('should be visible while loading an image', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
          var _render16, driver;
          return _regeneratorRuntime.wrap(function _callee20$(_context20) {
            while (1) switch (_context20.prev = _context20.next) {
              case 0:
                _render16 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render16.driver;
                _context20.t0 = expect;
                _context20.next = 4;
                return driver.isLoaderVisible();
              case 4:
                _context20.t1 = _context20.sent;
                (0, _context20.t0)(_context20.t1).toBe(true);
              case 6:
              case "end":
                return _context20.stop();
            }
          }, _callee20);
        })));
        it('should NOT be visible after image loaded', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
          var _render17, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee21$(_context21) {
            while (1) switch (_context21.prev = _context21.next) {
              case 0:
                _render17 = render(buildComponent({
                  imageUrl: imageUrl
                })), driver = _render17.driver;
                _context21.t0 = imageViewerPrivateDriver;
                _context21.next = 4;
                return driver.element();
              case 4:
                _context21.t1 = _context21.sent;
                _context21.t2 = fireEvent;
                _context21.t3 = {
                  element: _context21.t1,
                  eventTrigger: _context21.t2
                };
                privateDriver = (0, _context21.t0)(_context21.t3);
                _context21.next = 10;
                return privateDriver.simulateImageLoad();
              case 10:
                _context21.t4 = expect;
                _context21.next = 13;
                return driver.isLoaderVisible();
              case 13:
                _context21.t5 = _context21.sent;
                (0, _context21.t4)(_context21.t5).toBe(false);
              case 15:
              case "end":
                return _context21.stop();
            }
          }, _callee21);
        })));
      });
      describe('given no `imageUrl`', function () {
        it('should NOT be visible', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
          var _render18, driver;
          return _regeneratorRuntime.wrap(function _callee22$(_context22) {
            while (1) switch (_context22.prev = _context22.next) {
              case 0:
                _render18 = render(buildComponent({
                  imageUrl: undefined
                })), driver = _render18.driver;
                _context22.t0 = expect;
                _context22.next = 4;
                return driver.isLoaderVisible();
              case 4:
                _context22.t1 = _context22.sent;
                (0, _context22.t0)(_context22.t1).toBe(false);
              case 6:
              case "end":
                return _context22.stop();
            }
          }, _callee22);
        })));
      });
    });

    /* Overlay tests should move to e2e visual */
    describe.skip('Overlay', function () {
      it('should be visible while loading an image', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
        var _render19, driver;
        return _regeneratorRuntime.wrap(function _callee23$(_context23) {
          while (1) switch (_context23.prev = _context23.next) {
            case 0:
              _render19 = render(buildComponent({
                imageUrl: imageUrl
              })), driver = _render19.driver;
              _context23.t0 = expect;
              _context23.next = 4;
              return driver.isOverlayVisible();
            case 4:
              _context23.t1 = _context23.sent;
              (0, _context23.t0)(_context23.t1).toBe(true);
            case 6:
            case "end":
              return _context23.stop();
          }
        }, _callee23);
      })));
      it('should be visible while hovering an image', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
        var _render20, driver, privateDriver;
        return _regeneratorRuntime.wrap(function _callee24$(_context24) {
          while (1) switch (_context24.prev = _context24.next) {
            case 0:
              _render20 = render(buildComponent({
                imageUrl: imageUrl
              })), driver = _render20.driver;
              _context24.t0 = imageViewerPrivateDriver;
              _context24.next = 4;
              return driver.element();
            case 4:
              _context24.t1 = _context24.sent;
              _context24.t2 = {
                element: _context24.t1
              };
              privateDriver = (0, _context24.t0)(_context24.t2);
              _context24.next = 9;
              return privateDriver.simulateImageLoad();
            case 9:
              _context24.next = 11;
              return driver.hover();
            case 11:
              _context24.t3 = expect;
              _context24.next = 14;
              return driver.isOverlayVisible();
            case 14:
              _context24.t4 = _context24.sent;
              (0, _context24.t3)(_context24.t4).toBe(true);
            case 16:
            case "end":
              return _context24.stop();
          }
        }, _callee24);
      })));
      it('should NOT be visible when image is not currently loading and not being hovered', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
        var _render21, driver;
        return _regeneratorRuntime.wrap(function _callee25$(_context25) {
          while (1) switch (_context25.prev = _context25.next) {
            case 0:
              _render21 = render(buildComponent({
                imageUrl: undefined
              })), driver = _render21.driver;
              _context25.t0 = expect;
              _context25.next = 4;
              return driver.isOverlayVisible();
            case 4:
              _context25.t1 = _context25.sent;
              (0, _context25.t0)(_context25.t1).toBe(false);
            case 6:
            case "end":
              return _context25.stop();
          }
        }, _callee25);
      })));
    });
    describe('Update Button', function () {
      describe('`onUpdateImage` prop', function () {
        it('should call callback [when] clicked on update button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
          var onUpdateImage, _render22, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee26$(_context26) {
            while (1) switch (_context26.prev = _context26.next) {
              case 0:
                onUpdateImage = vi.fn();
                _render22 = render(buildComponent({
                  onUpdateImage: onUpdateImage,
                  imageUrl: imageUrl
                })), driver = _render22.driver;
                _context26.t0 = imageViewerPrivateDriver;
                _context26.next = 5;
                return driver.element();
              case 5:
                _context26.t1 = _context26.sent;
                _context26.t2 = fireEvent;
                _context26.t3 = {
                  element: _context26.t1,
                  eventTrigger: _context26.t2
                };
                privateDriver = (0, _context26.t0)(_context26.t3);
                _context26.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context26.next = 13;
                return driver.clickUpdate();
              case 13:
                expect(onUpdateImage).toHaveBeenCalled();
              case 14:
              case "end":
                return _context26.stop();
            }
          }, _callee26);
        })));
      });
      describe('tooltip', function () {
        it('should display provided content', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
          var updateImageInfo, props, _render23, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee27$(_context27) {
            while (1) switch (_context27.prev = _context27.next) {
              case 0:
                updateImageInfo = 'update image info';
                props = {
                  imageUrl: imageUrl,
                  updateImageInfo: updateImageInfo
                };
                _render23 = render(buildComponent(props)), driver = _render23.driver;
                _context27.t0 = imageViewerPrivateDriver;
                _context27.next = 6;
                return driver.element();
              case 6:
                _context27.t1 = _context27.sent;
                _context27.t2 = fireEvent;
                _context27.t3 = {
                  element: _context27.t1,
                  eventTrigger: _context27.t2
                };
                privateDriver = (0, _context27.t0)(_context27.t3);
                _context27.next = 12;
                return privateDriver.simulateImageLoad();
              case 12:
                _context27.next = 14;
                return driver.clickUpdate();
              case 14:
                _context27.t4 = expect;
                _context27.next = 17;
                return driver.getUpdateTooltipContent();
              case 17:
                _context27.t5 = _context27.sent;
                (0, _context27.t4)(_context27.t5).toBe(updateImageInfo);
              case 19:
              case "end":
                return _context27.stop();
            }
          }, _callee27);
        })));
      });
      describe('`updateButtonAriaLabel` prop', function () {
        it('should pass aria-label to update button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
          var updateButtonAriaLabel, _render24, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee28$(_context28) {
            while (1) switch (_context28.prev = _context28.next) {
              case 0:
                updateButtonAriaLabel = 'Change image';
                _render24 = render(buildComponent({
                  imageUrl: imageUrl,
                  updateButtonAriaLabel: updateButtonAriaLabel
                })), driver = _render24.driver;
                _context28.t0 = imageViewerPrivateDriver;
                _context28.next = 5;
                return driver.element();
              case 5:
                _context28.t1 = _context28.sent;
                _context28.t2 = fireEvent;
                _context28.t3 = {
                  element: _context28.t1,
                  eventTrigger: _context28.t2
                };
                privateDriver = (0, _context28.t0)(_context28.t3);
                _context28.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context28.t4 = expect;
                _context28.next = 14;
                return driver.getUpdateButtonAriaLabel();
              case 14:
                _context28.t5 = _context28.sent;
                (0, _context28.t4)(_context28.t5).toBe(updateButtonAriaLabel);
              case 16:
              case "end":
                return _context28.stop();
            }
          }, _callee28);
        })));
      });
    });
    describe('Remove Button', function () {
      describe('`onRemoveImage` prop', function () {
        it('should call callback [when] clicked on remove button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
          var onRemoveImage, _render25, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee29$(_context29) {
            while (1) switch (_context29.prev = _context29.next) {
              case 0:
                onRemoveImage = vi.fn();
                _render25 = render(buildComponent({
                  onRemoveImage: onRemoveImage,
                  imageUrl: imageUrl
                })), driver = _render25.driver;
                _context29.t0 = imageViewerPrivateDriver;
                _context29.next = 5;
                return driver.element();
              case 5:
                _context29.t1 = _context29.sent;
                _context29.t2 = fireEvent;
                _context29.t3 = {
                  element: _context29.t1,
                  eventTrigger: _context29.t2
                };
                privateDriver = (0, _context29.t0)(_context29.t3);
                _context29.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context29.next = 13;
                return driver.clickRemove();
              case 13:
                expect(onRemoveImage).toHaveBeenCalled();
              case 14:
              case "end":
                return _context29.stop();
            }
          }, _callee29);
        })));
      });
      describe('`showRemoveButton` prop', function () {
        it('should render remove button when prop is not passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
          var props, _render26, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee30$(_context30) {
            while (1) switch (_context30.prev = _context30.next) {
              case 0:
                props = {
                  imageUrl: imageUrl
                };
                _render26 = render(buildComponent(props)), driver = _render26.driver;
                _context30.t0 = imageViewerPrivateDriver;
                _context30.next = 5;
                return driver.element();
              case 5:
                _context30.t1 = _context30.sent;
                _context30.t2 = fireEvent;
                _context30.t3 = {
                  element: _context30.t1,
                  eventTrigger: _context30.t2
                };
                privateDriver = (0, _context30.t0)(_context30.t3);
                _context30.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context30.t4 = expect;
                _context30.next = 14;
                return driver.removeButtonExists();
              case 14:
                _context30.t5 = _context30.sent;
                (0, _context30.t4)(_context30.t5).toBe(true);
              case 16:
              case "end":
                return _context30.stop();
            }
          }, _callee30);
        })));
        it('should render remove button when prop equals to "true"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
          var props, _render27, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee31$(_context31) {
            while (1) switch (_context31.prev = _context31.next) {
              case 0:
                props = {
                  showRemoveButton: true,
                  imageUrl: imageUrl
                };
                _render27 = render(buildComponent(props)), driver = _render27.driver;
                _context31.t0 = imageViewerPrivateDriver;
                _context31.next = 5;
                return driver.element();
              case 5:
                _context31.t1 = _context31.sent;
                _context31.t2 = fireEvent;
                _context31.t3 = {
                  element: _context31.t1,
                  eventTrigger: _context31.t2
                };
                privateDriver = (0, _context31.t0)(_context31.t3);
                _context31.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context31.t4 = expect;
                _context31.next = 14;
                return driver.removeButtonExists();
              case 14:
                _context31.t5 = _context31.sent;
                (0, _context31.t4)(_context31.t5).toBe(true);
              case 16:
              case "end":
                return _context31.stop();
            }
          }, _callee31);
        })));
        it('should NOT render remove button when prop equals to "false"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
          var props, _render28, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee32$(_context32) {
            while (1) switch (_context32.prev = _context32.next) {
              case 0:
                props = {
                  showRemoveButton: false,
                  imageUrl: imageUrl
                };
                _render28 = render(buildComponent(props)), driver = _render28.driver;
                _context32.t0 = imageViewerPrivateDriver;
                _context32.next = 5;
                return driver.element();
              case 5:
                _context32.t1 = _context32.sent;
                _context32.t2 = fireEvent;
                _context32.t3 = {
                  element: _context32.t1,
                  eventTrigger: _context32.t2
                };
                privateDriver = (0, _context32.t0)(_context32.t3);
                _context32.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context32.t4 = expect;
                _context32.next = 14;
                return driver.removeButtonExists();
              case 14:
                _context32.t5 = _context32.sent;
                (0, _context32.t4)(_context32.t5).toBe(false);
              case 16:
              case "end":
                return _context32.stop();
            }
          }, _callee32);
        })));
      });
      describe('tooltip', function () {
        it('should display provided content', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
          var removeImageInfo, _render29, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee33$(_context33) {
            while (1) switch (_context33.prev = _context33.next) {
              case 0:
                removeImageInfo = 'remove image info';
                _render29 = render(buildComponent({
                  imageUrl: imageUrl,
                  removeImageInfo: removeImageInfo
                })), driver = _render29.driver;
                _context33.t0 = imageViewerPrivateDriver;
                _context33.next = 5;
                return driver.element();
              case 5:
                _context33.t1 = _context33.sent;
                _context33.t2 = fireEvent;
                _context33.t3 = {
                  element: _context33.t1,
                  eventTrigger: _context33.t2
                };
                privateDriver = (0, _context33.t0)(_context33.t3);
                _context33.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context33.next = 13;
                return driver.hover();
              case 13:
                _context33.t4 = expect;
                _context33.next = 16;
                return driver.getRemoveTooltipContent();
              case 16:
                _context33.t5 = _context33.sent;
                (0, _context33.t4)(_context33.t5).toBe(removeImageInfo);
              case 18:
              case "end":
                return _context33.stop();
            }
          }, _callee33);
        })));
      });
      describe('`removeButtonAriaLabel` prop', function () {
        it('should pass aria-label to remove button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
          var removeButtonAriaLabel, _render30, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee34$(_context34) {
            while (1) switch (_context34.prev = _context34.next) {
              case 0:
                removeButtonAriaLabel = 'Delete image';
                _render30 = render(buildComponent({
                  imageUrl: imageUrl,
                  removeButtonAriaLabel: removeButtonAriaLabel
                })), driver = _render30.driver;
                _context34.t0 = imageViewerPrivateDriver;
                _context34.next = 5;
                return driver.element();
              case 5:
                _context34.t1 = _context34.sent;
                _context34.t2 = fireEvent;
                _context34.t3 = {
                  element: _context34.t1,
                  eventTrigger: _context34.t2
                };
                privateDriver = (0, _context34.t0)(_context34.t3);
                _context34.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context34.t4 = expect;
                _context34.next = 14;
                return driver.getRemoveButtonAriaLabel();
              case 14:
                _context34.t5 = _context34.sent;
                (0, _context34.t4)(_context34.t5).toBe(removeButtonAriaLabel);
              case 16:
              case "end":
                return _context34.stop();
            }
          }, _callee34);
        })));
      });
    });
    describe('Download Button', function () {
      describe('`onDownloadImage` prop', function () {
        it('should call callback [when] clicked on download button', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
          var onDownloadImage, _render31, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee35$(_context35) {
            while (1) switch (_context35.prev = _context35.next) {
              case 0:
                onDownloadImage = vi.fn();
                _render31 = render(buildComponent({
                  onDownloadImage: onDownloadImage,
                  imageUrl: imageUrl,
                  showDownloadButton: true,
                  showRemoveButton: false
                })), driver = _render31.driver;
                _context35.t0 = imageViewerPrivateDriver;
                _context35.next = 5;
                return driver.element();
              case 5:
                _context35.t1 = _context35.sent;
                _context35.t2 = fireEvent;
                _context35.t3 = {
                  element: _context35.t1,
                  eventTrigger: _context35.t2
                };
                privateDriver = (0, _context35.t0)(_context35.t3);
                _context35.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context35.next = 13;
                return driver.clickDownload();
              case 13:
                expect(onDownloadImage).toHaveBeenCalled();
              case 14:
              case "end":
                return _context35.stop();
            }
          }, _callee35);
        })));
      });
      describe('`showDownloadButton` prop', function () {
        describe('when `showRemoveButton` prop is "false"', function () {
          it('should NOT render download button when prop is not passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
            var props, _render32, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee36$(_context36) {
              while (1) switch (_context36.prev = _context36.next) {
                case 0:
                  props = {
                    imageUrl: imageUrl
                  };
                  _render32 = render(buildComponent(props)), driver = _render32.driver;
                  _context36.t0 = imageViewerPrivateDriver;
                  _context36.next = 5;
                  return driver.element();
                case 5:
                  _context36.t1 = _context36.sent;
                  _context36.t2 = fireEvent;
                  _context36.t3 = {
                    element: _context36.t1,
                    eventTrigger: _context36.t2
                  };
                  privateDriver = (0, _context36.t0)(_context36.t3);
                  _context36.next = 11;
                  return privateDriver.simulateImageLoad();
                case 11:
                  _context36.t4 = expect;
                  _context36.next = 14;
                  return driver.downloadButtonExists();
                case 14:
                  _context36.t5 = _context36.sent;
                  (0, _context36.t4)(_context36.t5).toBe(false);
                case 16:
                case "end":
                  return _context36.stop();
              }
            }, _callee36);
          })));
          it('should render download button when prop equals to "true"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
            var props, _render33, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee37$(_context37) {
              while (1) switch (_context37.prev = _context37.next) {
                case 0:
                  props = {
                    showDownloadButton: true,
                    showRemoveButton: false,
                    imageUrl: imageUrl
                  };
                  _render33 = render(buildComponent(props)), driver = _render33.driver;
                  _context37.t0 = imageViewerPrivateDriver;
                  _context37.next = 5;
                  return driver.element();
                case 5:
                  _context37.t1 = _context37.sent;
                  _context37.t2 = fireEvent;
                  _context37.t3 = {
                    element: _context37.t1,
                    eventTrigger: _context37.t2
                  };
                  privateDriver = (0, _context37.t0)(_context37.t3);
                  _context37.next = 11;
                  return privateDriver.simulateImageLoad();
                case 11:
                  _context37.t4 = expect;
                  _context37.next = 14;
                  return driver.downloadButtonExists();
                case 14:
                  _context37.t5 = _context37.sent;
                  (0, _context37.t4)(_context37.t5).toBe(true);
                case 16:
                case "end":
                  return _context37.stop();
              }
            }, _callee37);
          })));
          it('should NOT render download button when prop equals to "false"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
            var props, _render34, driver, privateDriver;
            return _regeneratorRuntime.wrap(function _callee38$(_context38) {
              while (1) switch (_context38.prev = _context38.next) {
                case 0:
                  props = {
                    showDownloadButton: false,
                    showRemoveButton: false,
                    imageUrl: imageUrl
                  };
                  _render34 = render(buildComponent(props)), driver = _render34.driver;
                  _context38.t0 = imageViewerPrivateDriver;
                  _context38.next = 5;
                  return driver.element();
                case 5:
                  _context38.t1 = _context38.sent;
                  _context38.t2 = fireEvent;
                  _context38.t3 = {
                    element: _context38.t1,
                    eventTrigger: _context38.t2
                  };
                  privateDriver = (0, _context38.t0)(_context38.t3);
                  _context38.next = 11;
                  return privateDriver.simulateImageLoad();
                case 11:
                  _context38.t4 = expect;
                  _context38.next = 14;
                  return driver.downloadButtonExists();
                case 14:
                  _context38.t5 = _context38.sent;
                  (0, _context38.t4)(_context38.t5).toBe(false);
                case 16:
                case "end":
                  return _context38.stop();
              }
            }, _callee38);
          })));
        });
      });
    });
    describe('More Actions Button', function () {
      it('should render more button when all three actions enabled', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
        var props, _render35, driver, privateDriver;
        return _regeneratorRuntime.wrap(function _callee39$(_context39) {
          while (1) switch (_context39.prev = _context39.next) {
            case 0:
              props = {
                imageUrl: imageUrl,
                showRemoveButton: true,
                showUpdateButton: true,
                showDownloadButton: true
              };
              _render35 = render(buildComponent(props)), driver = _render35.driver;
              _context39.t0 = imageViewerPrivateDriver;
              _context39.next = 5;
              return driver.element();
            case 5:
              _context39.t1 = _context39.sent;
              _context39.t2 = fireEvent;
              _context39.t3 = {
                element: _context39.t1,
                eventTrigger: _context39.t2
              };
              privateDriver = (0, _context39.t0)(_context39.t3);
              _context39.next = 11;
              return privateDriver.simulateImageLoad();
            case 11:
              _context39.t4 = expect;
              _context39.next = 14;
              return driver.moreButtonExists();
            case 14:
              _context39.t5 = _context39.sent;
              (0, _context39.t4)(_context39.t5).toBe(true);
            case 16:
            case "end":
              return _context39.stop();
          }
        }, _callee39);
      })));
      describe('tooltip', function () {
        it('should display provided content', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
          var moreImageInfo, _render36, driver, privateDriver;
          return _regeneratorRuntime.wrap(function _callee40$(_context40) {
            while (1) switch (_context40.prev = _context40.next) {
              case 0:
                moreImageInfo = 'more image actions';
                _render36 = render(buildComponent({
                  imageUrl: imageUrl,
                  moreImageInfo: moreImageInfo,
                  showRemoveButton: true,
                  showUpdateButton: true,
                  showDownloadButton: true
                })), driver = _render36.driver;
                _context40.t0 = imageViewerPrivateDriver;
                _context40.next = 5;
                return driver.element();
              case 5:
                _context40.t1 = _context40.sent;
                _context40.t2 = fireEvent;
                _context40.t3 = {
                  element: _context40.t1,
                  eventTrigger: _context40.t2
                };
                privateDriver = (0, _context40.t0)(_context40.t3);
                _context40.next = 11;
                return privateDriver.simulateImageLoad();
              case 11:
                _context40.next = 13;
                return driver.hover();
              case 13:
                _context40.t4 = expect;
                _context40.next = 16;
                return driver.getMoreTooltipContent();
              case 16:
                _context40.t5 = _context40.sent;
                (0, _context40.t4)(_context40.t5).toBe(moreImageInfo);
              case 18:
              case "end":
                return _context40.stop();
            }
          }, _callee40);
        })));
      });
    });
    describe('status attribute', function () {
      it('should have no status', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee41() {
        var props, _render37, driver;
        return _regeneratorRuntime.wrap(function _callee41$(_context41) {
          while (1) switch (_context41.prev = _context41.next) {
            case 0:
              props = _objectSpread({
                imageUrl: '',
                width: 300,
                height: 300
              }, test);
              _render37 = render(buildComponent(props)), driver = _render37.driver;
              _context41.t0 = expect;
              _context41.next = 5;
              return driver.hasStatus('error');
            case 5:
              _context41.t1 = _context41.sent;
              (0, _context41.t0)(_context41.t1).toBe(false);
            case 7:
            case "end":
              return _context41.stop();
          }
        }, _callee41);
      })));
      it.each([{
        status: 'error'
      }, {
        status: 'warning'
      }, {
        status: 'loading'
      }])('should display status when %p', /*#__PURE__*/function () {
        var _ref46 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee42(test) {
          var props, _render38, driver;
          return _regeneratorRuntime.wrap(function _callee42$(_context42) {
            while (1) switch (_context42.prev = _context42.next) {
              case 0:
                props = _objectSpread({
                  imageUrl: '',
                  width: 300,
                  height: 300
                }, test);
                _render38 = render(buildComponent(props)), driver = _render38.driver;
                _context42.t0 = expect;
                _context42.next = 5;
                return driver.hasStatus(test.status);
              case 5:
                _context42.t1 = _context42.sent;
                (0, _context42.t0)(_context42.t1).toBe(true);
              case 7:
              case "end":
                return _context42.stop();
            }
          }, _callee42);
        }));
        return function (_x) {
          return _ref46.apply(this, arguments);
        };
      }());
      it.each([{
        status: 'error',
        statusMessage: 'Error Message'
      }, {
        status: 'warning',
        statusMessage: 'Warning Message'
      }, {
        status: 'loading',
        statusMessage: 'Loading Message'
      }])('should display status with message when %p', /*#__PURE__*/function () {
        var _ref47 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee43(test) {
          var props, _render39, driver;
          return _regeneratorRuntime.wrap(function _callee43$(_context43) {
            while (1) switch (_context43.prev = _context43.next) {
              case 0:
                props = _objectSpread({
                  imageUrl: '',
                  width: 300,
                  height: 300
                }, test);
                _render39 = render(buildComponent(props)), driver = _render39.driver;
                _context43.t0 = expect;
                _context43.next = 5;
                return driver.hasStatus(test.status);
              case 5:
                _context43.t1 = _context43.sent;
                (0, _context43.t0)(_context43.t1).toBe(true);
                _context43.t2 = expect;
                _context43.next = 10;
                return driver.getStatusMessage();
              case 10:
                _context43.t3 = _context43.sent;
                (0, _context43.t2)(_context43.t3).toBe(test.statusMessage);
              case 12:
              case "end":
                return _context43.stop();
            }
          }, _callee43);
        }));
        return function (_x2) {
          return _ref47.apply(this, arguments);
        };
      }());
    });
    describe('styles', function () {
      describe('height and width', function () {
        it('should be added to style attribute when image is not present', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
          var props, _render40, driver;
          return _regeneratorRuntime.wrap(function _callee44$(_context44) {
            while (1) switch (_context44.prev = _context44.next) {
              case 0:
                props = {
                  imageUrl: '',
                  width: 300,
                  height: 300
                };
                _render40 = render(buildComponent(props)), driver = _render40.driver;
                _context44.t0 = expect;
                _context44.next = 5;
                return driver.getContainerStyles();
              case 5:
                _context44.t1 = _context44.sent;
                (0, _context44.t0)(_context44.t1).toEqual('width: 300px; height: 300px;');
              case 7:
              case "end":
                return _context44.stop();
            }
          }, _callee44);
        })));
        it('should be added to style attribute when image is present', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
          var props, _render41, driver;
          return _regeneratorRuntime.wrap(function _callee45$(_context45) {
            while (1) switch (_context45.prev = _context45.next) {
              case 0:
                props = {
                  imageUrl: imageUrl,
                  width: 300,
                  height: 300
                };
                _render41 = render(buildComponent(props)), driver = _render41.driver;
                _context45.t0 = expect;
                _context45.next = 5;
                return driver.getContainerStyles();
              case 5:
                _context45.t1 = _context45.sent;
                (0, _context45.t0)(_context45.t1).toEqual('width: 300px; height: 300px;');
              case 7:
              case "end":
                return _context45.stop();
            }
          }, _callee45);
        })));
        it('should not add style attribute when width and height props are not passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
          var props, _render42, driver;
          return _regeneratorRuntime.wrap(function _callee46$(_context46) {
            while (1) switch (_context46.prev = _context46.next) {
              case 0:
                props = {
                  imageUrl: imageUrl
                };
                _render42 = render(buildComponent(props)), driver = _render42.driver;
                _context46.t0 = expect;
                _context46.next = 5;
                return driver.getContainerStyles();
              case 5:
                _context46.t1 = _context46.sent;
                (0, _context46.t0)(_context46.t1).toEqual(null);
              case 7:
              case "end":
                return _context46.stop();
            }
          }, _callee46);
        })));
      });
    });
  }
});