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

export default function SubTitleUniDriver(base: UniDriver, body: UniDriver) {
  const getLearnMoreButton = () =>
    TextButtonUniDriver(base.$(`[data-hook="subtitle-learn-more-cta"]`), body);
  return {
    getLearnMoreButton,

    getText() {
      return base.$('[data-hook="page-subtitle"]').text();
    },
    getLearnMoreLabel() {
      return getLearnMoreButton().getButtonTextContent();
    },
    getLearnMoreHref() {
      return this.getLearnMoreButton().getHref();
    },
    ...baseUniDriverFactory(base),
  };
}
