"use strict";

exports.__esModule = true;
exports.EditableTableContextMenuUniDriver = EditableTableContextMenuUniDriver;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
function EditableTableContextMenuUniDriver(_base, body) {
  const menuBase = body.$('[data-hook="editable-table-context-menu"]');
  const getDropdownLayout = () => (0, _unidriver.DropdownLayoutUniDriver)(menuBase, body);
  return {
    isShown: async () => menuBase.exists(),
    isOptionVisible: async optionId => {
      if (!(await menuBase.exists())) {
        return false;
      }
      return body.$(`[data-hook="dropdown-item-${optionId}"]`).exists();
    },
    clickOption: async optionId => {
      const option = await getDropdownLayout().optionById(optionId);
      await option.click();
    },
    getOptionText: async optionId => {
      const option = await getDropdownLayout().optionById(optionId);
      return option.content();
    }
  };
}
//# sourceMappingURL=EditableTableContextMenu.uni.driver.js.map