import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { ActionControlUniDriver } from '../ActionControl/ActionControl.uni.driver';

export const ToolbarSecondaryActionsUniDriver = (
  base: UniDriver,
  body: UniDriver,
) => {
  const getSecondaryActions = (
    dataHook = 'toolbar-secondary-actions',
    index: number,
  ) => {
    const dataHookWithIndex = `${dataHook}-${index}`;
    return ActionControlUniDriver(base, body).getActionControl(
      dataHookWithIndex,
    );
  };

  return {
    getSecondaryActions,
  };
};
