import { InputWithOptionsUniDriver, TabsUniDriver, } from '@wix/design-system/dist/testkit/unidriver';
import { baseUniDriverFactory } from '../../unidriver';
export function TabsFilterUniDriver(base, body) {
    const tabsBase = () => base.$('[data-hook="tabs-default"]');
    const tabsUniDriver = TabsUniDriver(tabsBase(), body);
    const getTabs = () => tabsBase().$$('[data-hook="tabs-filter-tab-title"]');
    const getTabAt = (index) => getTabs().get(index);
    return {
        /**
         * Wait for tabs filter to render
         * @param timeout
         */
        wait: (timeout) => base.wait(timeout),
        ...baseUniDriverFactory(base),
        /**
         * Get all tabs titles text
         */
        getTitles: () => getTabs().map((e) => e.$('[data-hook="title-text"]').text()),
        /**
         *
         * Get all tabs total text (requires <TabTotalParens />)
         */
        getParensTotals: () => getTabs().map((e) => e.$('[data-hook="title-badge"]').$('[data-hook="total"]').text()),
        /**
         * Get all tabs total text (requires <TabTotalCounterBadge />)
         */
        getCounterBadgeTotals: () => getTabs().map((e) => e.$('[data-hook="title-badge"]').text()),
        /**
         * Get the index of the current active tab
         */
        getActiveTabIndex: () => tabsUniDriver.getActiveTabIndex(),
        /**
         * Click a tab
         * @param index
         */
        clickTabAt: (index) => tabsUniDriver.clickTabAt(index),
        /**
         * Hover a tab
         * @param index
         */
        hoverTabAt: (index) => getTabAt(index).hover(),
        /**
         * Get the title text of a tab
         * @param index
         */
        getTitleTextAt: (index) => getTabs().get(index).$('[data-hook="title-text"]').text(),
        /**
         * Get the total text of a tab (requires <TabTotalCounterBadge />)
         * @param index
         */
        getTotalBadgeTextAt: (index) => getTabs().get(index).$('[data-hook="title-badge"]').text(),
        /**
         * Get the total text of a tab (requires <TabTotalParens />)
         * @param index
         */
        getTotalParensTextAt: (index) => getTabs()
            .get(index)
            .$('[data-hook="title-badge"]')
            .$('[data-hook="total"]')
            .text(),
        dropdown: () => InputWithOptionsUniDriver(base.$('[data-hook="tabs-dropdown"]'), body),
        tabsBadgesExists: () => getTabs().at(0).$('[data-hook="title-badge"]').exists(),
    };
}
export default TabsFilterUniDriver;
//# sourceMappingURL=TabsFilter.uni.driver.js.map