import { dataHook } from "./../wix-rich-content-common/index.js";
import { INSERT_CODE_BLOCK_BUTTON, ROOT } from "./data-hooks.js";
import { toolbarsToAddIn } from "./get-add-buttons.js";
const createCodeBlockTestkit = (getBase) => {
  const getCodeBlock = async (index) => {
    const codeBlock = await getBase().getAll(dataHook(ROOT));
    return codeBlock.at(index);
  };
  return {
    content: {
      atIndex: (index) => {
        return {
          exists: async () => {
            try {
              const codeBlock = await getCodeBlock(index);
              return codeBlock.exists();
            } catch {
              return false;
            }
          }
        };
      }
    },
    toolbars: {
      createAddButtonToolbars: (getBase2) => ({
        click: async () => {
          const codeBlockButton = await getBase2().get(dataHook(INSERT_CODE_BLOCK_BUTTON));
          await codeBlockButton.click();
        },
        toolbarsToAddIn
      })
    }
  };
};
export {
  createCodeBlockTestkit
};
//# sourceMappingURL=testkit.js.map
