import { DATA_HOOK } from './ListItemSelect.constants';
import { baseUniDriverFactory, findByHook, } from '../utils/test-utils/unidriver';
// TODO: Add tooltipTestkitDriver when raising major version.
export const listItemSelectDriverFactory = (base) => {
    return {
        ...baseUniDriverFactory(base),
        /** Check whether the checkbox appears */
        hasCheckbox: async () => await findByHook(base, DATA_HOOK.CHECKBOX).exists(),
        /** Get prefix */
        getPrefix: () => findByHook(base, DATA_HOOK.PREFIX),
        /** Get title Text */
        getTitle: async () => await findByHook(base, DATA_HOOK.TITLE).text(),
        /** Get subtitle Text */
        getSubtitle: async () => {
            const subtitleElement = await findByHook(base, DATA_HOOK.SUBTITLE);
            if (await subtitleElement.exists()) {
                return subtitleElement.text();
            }
            // @ts-expect-error users expect string return type
            return undefined;
        },
        /** Get suffix */
        getSuffix: () => findByHook(base, DATA_HOOK.SUFFIX),
    };
};
//# sourceMappingURL=ListItemSelect.uni.driver.js.map