import { DropdownBaseUniDriver, SegmentedToggleUniDriver, } from '@wix/design-system/dist/testkit/unidriver';
export function TableGridSwitchButtonUniDriver(base, body) {
    const getSegmented = () => SegmentedToggleUniDriver(base, body);
    // New DropdownBase driver (experiment enabled)
    const getDropdown = () => DropdownBaseUniDriver(body.$('[data-hook="layout-switch-popover"]'), body);
    const getLayoutSwitchButton = () => body.$('[data-hook="layout-switch-button"]');
    return {
        ...getSegmented(),
        /** Check if the SegmentedToggle (old UI) exists */
        exists: () => base.exists(),
        /** Click table button in SegmentedToggle (old UI) */
        clickTableButton: () => base
            .$(`[data-hook="toggle-option-table"] [data-hook="toggle-icon"]`)
            .click(),
        /** Click grid button in SegmentedToggle (old UI) */
        clickGridButton: () => base
            .$(`[data-hook="toggle-option-grid"] [data-hook="toggle-icon"]`)
            .click(),
        popoverExists: () => getDropdown().exists(),
        layoutSwitchButtonExists: () => getLayoutSwitchButton().exists(),
        openPopover: () => getLayoutSwitchButton().click(),
        isPopoverOpen: () => getDropdown().isDropdownShown(),
        clickLayoutOption: (option) => getDropdown().selectOptionByDataHook(`layout-option-${option}`),
        getLayoutOptionsCount: () => getDropdown().optionsCount(),
    };
}
export default TableGridSwitchButtonUniDriver;
//# sourceMappingURL=TableGridSwitchButton.uni.driver.js.map