import { baseUniDriverFactory, findByHook, } from '../utils/test-utils/unidriver';
import { DATA_HOOK } from './constants';
import inputUniDriverFactory from '../Input/Input.uni.driver';
export const TimeInputDriverFactory = (base, body) => {
    const inputDriver = inputUniDriverFactory(findByHook(base, DATA_HOOK.TimeInputInput), body);
    return {
        ...baseUniDriverFactory(base, body),
        /**
         * Gets passed date value
         * @returns {Promise<Date>}
         */
        getValue: async () => new Date(parseInt(await base.attr('data-value'))),
        /**
         * Sets given value as an input value
         * @param {string} value text value to input
         * @returns {Promise<void>}
         */
        setValue: async (value) => inputDriver.enterText(value),
        /**
         * Confirms typed in value
         * @returns {Promise<void>}
         */
        confirmValue: async () => inputDriver.blur(),
        /**
         * Gets passed locale
         * @returns {Promise<string>}
         */
        getLocale: async () => base.attr('data-locale'),
        /**
         * Gets passed timeStyle
         * @returns {Promise<string>}
         */
        getTimeStyle: async () => base.attr('data-time-style'),
        /**
         * Checks if TimeInput is disabled
         * @return {Promise<boolean>}
         */
        isDisabled: async () => inputDriver.isDisabled(),
        /** Checks if TimeInput has status
         * @param {string} status status to check
         * @returns {Promise<boolean>}
         */
        hasStatus: async (status) => inputDriver.hasStatus(status),
        /**
         * Gets TimeInput status message
         * @returns {Promise<string | null>}
         */
        getStatusMessage: async () => inputDriver.getStatusMessage(),
    };
};
//# sourceMappingURL=TimeInput.uni.driver.js.map