import {
  createDropdownModalUniDriver
} from "./../_shared/dropdown-modal/dropdown-modal-uni-driver.js";
import { dataHook } from "./../wix-rich-content-common/index.js";
import { TEXT_BUTTON_HEADINGS } from "./data-hooks.js";
const createHeadingsTestkit = (getBase) => {
  return {
    content: {
      atIndex: (index, level = 1) => {
        const getHeading = () => {
          const heading = getBase().$$(`h${level}`);
          return heading.get(index);
        };
        return {
          exists: async () => {
            const heading = getHeading();
            return heading.exists();
          },
          getAttribute: async (attr) => {
            const heading = getHeading();
            return heading.attr(attr);
          }
        };
      }
    },
    toolbars: {
      createTextButtonToolbars: (getTextButtonToolbarBase) => {
        const getButton = async () => getTextButtonToolbarBase().get(dataHook(TEXT_BUTTON_HEADINGS));
        return {
          getButton,
          getButtonText: async () => {
            const button = await getButton();
            return await button.text();
          },
          click: async () => {
            const button = await getButton();
            await button.click();
          },
          dropdown: createDropdownModalUniDriver(getBase)
        };
      }
    }
  };
};
export {
  createHeadingsTestkit
};
//# sourceMappingURL=testkit.js.map
