import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../../../unidriver';

export function DateTimeViewUniDriver(base: UniDriver, _body: UniDriver) {
  return {
    ...baseUniDriverFactory(base),
    getFormattedDate: () => base.$('[data-sub-cell="date"]').text(),
    getFormattedTime: () => base.$('[data-sub-cell="time"]').text(),
    getPlaceholder: () => base.text(),
    hasDivider: () =>
      base
        .$$('[aria-hidden]')
        .count()
        .then((n) => n > 0),
  };
}
