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

export function DateEditUniDriver(base: UniDriver, body: UniDriver) {
  const datePicker = DatePickerUniDriver(base, body);

  return {
    ...baseUniDriverFactory(base),
    getInputValue: () => datePicker.inputDriver.getValue(),
    keyDown: (
      key: string,
      opts?: { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean },
    ) => datePicker.inputDriver.keyDown({ key, ...opts }),
    blur: () => datePicker.inputDriver.blur(),
    clickInput: () => datePicker.inputDriver.click(),
  };
}
