import { baseUniDriverFactory, findByHook, } from '../utils/test-utils/unidriver';
import { dataHooks } from './TrendIndicator.constants';
export const trendIndicatorDriverFactory = (base) => {
    return {
        ...baseUniDriverFactory(base),
        /**
         * Returns true if trend icon exist
         */
        hasTrendIndicatorIcon: () => findByHook(base, dataHooks.trendIndicatorIcon).exists(),
        /**
         * Returns true if trend icon is sort up
         */
        isTrendIndicatorIconUp: () => findByHook(base, dataHooks.trendIndicatorUp).exists(),
        /**
         * Returns true if trend icon is sort down
         */
        isTrendIndicatorIconDown: () => findByHook(base, dataHooks.trendIndicatorDown).exists(),
        /**
         * Gets trend value
         */
        getTrendValue: async () => {
            const text = await findByHook(base, dataHooks.trendIndicatorValue).text();
            return Number(text.replace('%', ''));
        },
        /**
         * Gets formatted trend value
         */
        getFormattedTrendValue: async () => {
            const text = await findByHook(base, dataHooks.trendIndicatorValue).text();
            return text;
        },
    };
};
//# sourceMappingURL=TrendIndicator.uni.driver.js.map