import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../unidriver';
import {
  ButtonUniDriver,
  TooltipUniDriver,
} from '@wix/design-system/dist/testkit/unidriver';

export function DisabledTooltipButtonUniDriver(
  base: UniDriver,
  body: UniDriver,
  { dataHook }: { dataHook: string },
) {
  const buttonBase = () => base.$$(`[data-hook="${dataHook}"]`).get(0);

  return {
    ...baseUniDriverFactory(buttonBase()),
    ...ButtonUniDriver(buttonBase(), body),
    hover: () => buttonBase().hover(),
    getTooltipText: () =>
      TooltipUniDriver(
        base.$(`[data-hook="${dataHook}-disabled-tooltip"]`),
        body,
      ).getTooltipText(),
  };
}
