"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.BulkActionToolbarDriver = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = require("@testing-library/react");
var _react2 = _interopRequireDefault(require("react"));
var _chance = require("chance");
var _BulkActionToolbar = require("./BulkActionToolbar");
var _BulkActionToolbarUni = require("./BulkActionToolbar.uni.driver");
var _vanilla = require("@wix/wix-ui-test-utils/vanilla");
var _internal = require("@wix/bex-core/testkit/internal");
var _testUtils = require("../../test-utils");
var _CollectionContext = require("../CollectionContext");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/BulkActionToolbar/BulkActionToolbar.driver.tsx";
class BulkActionToolbarDriver {
  constructor() {
    (0, _defineProperty2.default)(this, "chance", new _chance.Chance());
    (0, _defineProperty2.default)(this, "_renderResult", void 0);
    (0, _defineProperty2.default)(this, "state", void 0);
    this.state = new _internal.ProductsCollectionStateDriver();
  }
  get backend() {
    return this.state.backend;
  }
  get collection() {
    return this.state.collection;
  }
  get container() {
    return this.state.container;
  }
  get i18n() {
    return this.container.i18n;
  }
  get renderResult() {
    if (this._renderResult == null) {
      throw new Error('Driver was not initialized');
    }
    return this._renderResult;
  }
  getBulkActionToolbar() {
    return (0, _vanilla.uniTestkitFactoryCreator)(_BulkActionToolbarUni.BulkActionToolbarUniDriver)({
      wrapper: this.renderResult.baseElement,
      dataHook: 'bulk-action-toolbar'
    });
  }
  render(overrides = {}) {
    this._renderResult = (0, _react.render)(/*#__PURE__*/_react2.default.createElement(_testUtils.CairoTestApp, {
      driver: this.container,
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 54,
        columnNumber: 7
      }
    }, /*#__PURE__*/_react2.default.createElement(_CollectionContext.CollectionProvider, {
      value: this.collection,
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 55,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react2.default.createElement(_BulkActionToolbar.BulkActionToolbar, (0, _extends2.default)({}, overrides, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 56,
        columnNumber: 11
      }
    })))));
  }
}
exports.BulkActionToolbarDriver = BulkActionToolbarDriver;
//# sourceMappingURL=BulkActionToolbar.driver.js.map