import { dataHook } from "./../../../../wix-rich-content-common/index.js";
import { FLOATING_FORMATTING_TOOLBAR } from "../index.js";
const createFloatingFormattingToolbarTestkit = (getBase, createTextButtonToolbarPluginTestkits) => {
  const getFloatingFormatting = () => getBase().$(dataHook(FLOATING_FORMATTING_TOOLBAR));
  return {
    exists: async () => {
      return getFloatingFormatting().exists();
    },
    waitForElement: async () => {
      const floatingFormatting = getFloatingFormatting();
      await floatingFormatting.wait();
      return floatingFormatting;
    },
    getButtonsAmount: async () => {
      const buttons = getFloatingFormatting().$$("button");
      return await buttons.count();
    },
    scrollToElementByIndex: async (index) => {
      const button = getFloatingFormatting().$$("button").get(index);
      if (!button) {
        throw new Error(`Floating formatting toolbar doesn't have a button at index ${index}`);
      }
      await button.scrollIntoView?.();
    },
    plugins: createTextButtonToolbarPluginTestkits(getFloatingFormatting)
  };
};
export {
  createFloatingFormattingToolbarTestkit
};
//# sourceMappingURL=floating-formatting.testkit.js.map
