"use strict";

exports.__esModule = true;
exports.MoreActionsUniDriver = void 0;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
const MoreActionsUniDriver = (base, body) => {
  const moreActionsPopoverDriver = dataHook => (0, _unidriver.PopoverMenuUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  const getMoreActions = (dataHook = 'more-actions') => ({
    exists: () => moreActionsPopoverDriver(dataHook).exists(),
    /** Gets trigger element of more Actions */
    getTriggerElement: () => moreActionsPopoverDriver(dataHook).getTriggerElement('more-actions-popover-button'),
    /** Opens the more actions popover */
    open: () => moreActionsPopoverDriver(dataHook).getTriggerElement('more-actions-popover-button').click(),
    /** Indicates whether the more actions popover is open */
    isOpen: () => moreActionsPopoverDriver(dataHook).isMenuOpen(),
    /** Clicks at child by data-hook */
    clickAtChildByDataHook: childDataHook => moreActionsPopoverDriver(dataHook).clickAtChildByDataHook(childDataHook),
    /** Clicks at child by index */
    clickAtChildByIndex: index => moreActionsPopoverDriver(dataHook).clickAtChild(index),
    /** Gets content at index */
    childContentAt: index => moreActionsPopoverDriver(dataHook).itemContentAt(index),
    /** Gets children count */
    childrenCount: () => moreActionsPopoverDriver(dataHook).childrenCount(),
    getTooltip: () => {
      return (0, _unidriver.TooltipUniDriver)(base.$('[data-hook="more-actions-tooltip"]'), body);
    }
  });
  return {
    getMoreActions
  };
};
exports.MoreActionsUniDriver = MoreActionsUniDriver;
//# sourceMappingURL=MoreActions.uni.driver.js.map