import { thumbnailDriverFactory as publicDriverFactory } from './Thumbnail.uni.driver';
import { dataHooks } from './constants';
import { isElementFocused } from '../utils/test-utils/unidriver';
export const thumbnailPrivateDriverFactory = (base) => {
    const byHook = (hook) => base.$(`[data-hook*="${hook}"]`);
    const publicDriver = publicDriverFactory(base);
    return {
        ...publicDriver,
        /** Does the title exist */
        titleExists: () => byHook(dataHooks.thumbnailTitle).exists(),
        /** Does bottom title exist */
        bottomTitleExists: () => byHook(dataHooks.thumbnailBottomTitle).exists(),
        /** Does the description exist */
        descriptionExists: () => byHook(dataHooks.thumbnailDescription).exists(),
        /** Does the selected icon exist */
        selectedIconExists: () => !!publicDriver.getSelectedIcon(),
        /** Does the thumbnails image exist */
        imageExists: () => byHook(dataHooks.thumbnailImage).exists(),
        /** Does custom child exist */
        customChildExists: () => byHook('custom-child').exists(),
        /** Trigger keyDown event */
        keyDown: base.pressKey.bind(base),
        /** Trigger mouseOver event */
        mouseOver: () => byHook(dataHooks.thumbnailWrapper).hover(),
        /** Check if the thumbnail is focused */
        isFocused: async () => {
            const thumbnailWrapper = byHook(dataHooks.thumbnailWrapper);
            return (await isElementFocused(thumbnailWrapper)) || false;
        },
    };
};
//# sourceMappingURL=Thumbnail.private.uni.driver.js.map