import { ButtonUniDriver } from '@wix/design-system/dist/testkit/unidriver';
import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import ExportModalUniDriver from './ExportModal.uni.driver';

export function ExportButtonUniDriver(base: UniDriver, body: UniDriver) {
  const getButton = () => ButtonUniDriver(base, body);
  const exportModal = ExportModalUniDriver(base, body);

  return {
    ...exportModal,
    /** Clicks the button to open export modal */
    click: () => getButton().click(),
    /** Indicates whether export button exists in the table toolbar */
    exists: () => getButton().exists(),
  };
}

export default ExportButtonUniDriver;
