import { baseUniDriverFactory } from '../../utils/test-utils/unidriver';
import { DataHooks } from './constants';
export const paginationCoreUniDriverFactory = (base) => {
    const byDataHook = (dataHook) => base.$(`[data-hook="${dataHook}"]`);
    return {
        ...baseUniDriverFactory(base),
        /** Check if element is rendered */
        isVisible: async () => byDataHook(DataHooks.pageStrip).exists(),
        /** Returns currently selected page */
        getCurrentPage: async () => parseInt(await base.$(`[data-hook~=${DataHooks.currentPage}]`).text(), 10),
        /** Returns a total amount of pages available */
        getTotalPages: async () => parseInt(await byDataHook(DataHooks.totalPages).text(), 10),
        /** Clicks on gives page number */
        clickOnPage: async (n) => byDataHook(`page-${n}`).click(),
        /** Clicks on next button */
        clickNextButton: async () => byDataHook(DataHooks.next).click(),
        /** Clicks on previous button */
        clickPreviousButton: async () => byDataHook(DataHooks.previous).click(),
    };
};
//# sourceMappingURL=PaginationCore.uni.driver.js.map