import { dataHook } from "./../../../../wix-rich-content-common/index.js";
import { STATIC_TOOLBAR_DATA_HOOK } from "../index.js";
const createStaticToolbarTestkit = (getBase, createStaticToolbarPluginTestkits) => {
  const getStaticToolbar = () => getBase().$(dataHook(STATIC_TOOLBAR_DATA_HOOK));
  return {
    exists: async () => {
      return getStaticToolbar().exists();
    },
    waitForElement: async () => {
      const staticToolbar = getStaticToolbar();
      await staticToolbar.wait();
      return staticToolbar;
    },
    getButtonsAmount: async () => {
      const buttons = getStaticToolbar().$$("button");
      return await buttons.count();
    },
    scrollToElementByIndex: async (index) => {
      const button = getStaticToolbar().$$("button").get(index);
      if (!button) {
        throw new Error(`Static toolbar doesn't have a button at index ${index}`);
      }
      await button.scrollIntoView?.();
    },
    plugins: createStaticToolbarPluginTestkits(getStaticToolbar)
  };
};
export {
  createStaticToolbarTestkit
};
//# sourceMappingURL=static.testkit.js.map
