import { baseUniDriverFactory } from '../../unidriver';
import { BadgeUniDriver, PageHeaderUniDriver, } from '@wix/design-system/dist/testkit/unidriver';
import { FormPageContentUniDriver } from '../FormPageContent/FormPageContent.uni.driver';
export const EntityPageUniDriver = (base, body) => {
    const formPageContentUniDriver = FormPageContentUniDriver(base, body);
    /** Check if the EntityPage.Card shows a skeleton header */
    const cardShowsSkeletonHeader = (dataHook) => formPageContentUniDriver.getCard(dataHook).showsSkeletonHeader();
    /** Returns EntityPage.Slots driver by dataHook */
    const getSlots = (dataHook) => ({
        showsSkeletonHeader: () => cardShowsSkeletonHeader(dataHook),
        getChildByDataHook: (childDataHook) => base.$(`[data-hook="${childDataHook}"]`),
        ...baseUniDriverFactory(base.$(`[data-hook="${dataHook}"]`)),
    });
    const getBadgeAt = (index) => {
        return BadgeUniDriver(base.$(`[data-hook="form-page-header-badge-${index}"]`), body);
    };
    return {
        /** Returns EntityPage.Extensions driver by dataHook */
        getExtensions: getSlots,
        /** Returns EntityPage.Slots driver by dataHook */
        getSlots,
        /** Returns page header driver */
        getPageHeader: () => {
            const pageHeader = PageHeaderUniDriver(base.$(`[data-hook="entity-page-header"]`), body);
            return {
                ...pageHeader,
                getBadgeAt,
            };
        },
        /** Returns badge driver at index */
        getBadgeAt,
        ...formPageContentUniDriver,
        ...baseUniDriverFactory(base),
    };
};
//# sourceMappingURL=EntityPage.uni.driver.js.map