UNPKG

wix-style-react

Version:
33 lines (27 loc) 883 B
import { baseUniDriverFactory, findByHook } from '../../test/utils/unidriver'; import { dataHooks } from './constants'; export const sidebarNextDriverFactory = (base, body) => { return { ...baseUniDriverFactory(base, body), /** * Gets the current selected key * @returns {Promise<string>} */ getSelectedKey: async () => base.attr('data-selected'), /** * Gets the current skin * @returns {Promise<string>} */ getSkin: async () => base.attr('data-skin'), /** * Checks whether the header element exists * @returns {Promise<boolean>} */ headerExists: async () => (await findByHook(base, dataHooks.header)).exists(), /** * Checks whether the footer element exists * @returns {Promise<boolean>} */ footerExists: async () => (await findByHook(base, dataHooks.footer)).exists(), }; };