wix-style-react
Version:
24 lines (20 loc) • 806 B
JavaScript
import { tableListItemDriverFactory as publicDriverFactory } from '../TableListItem.uni.driver';
import { dataHooks } from '../constants';
export const tableListItemPrivateDriverFactory = (base, body) => {
const getOptionsContainer = () =>
base.$(`[data-hook="${dataHooks.tableListItemOptionsContainer}"]`);
return {
...publicDriverFactory(base, body),
getStyle: () => getOptionsContainer().attr('style'),
clickCheckboxContainer: () =>
base
.$(`[data-hook="${dataHooks.tableListItemCheckboxContainer}"]`)
.click(),
isDragHandleExists: () =>
base.$(`[data-hook="${dataHooks.tableListItemDragHandle}"]`).exists(),
isFocused: async () => {
const element = await base.getNative();
return document.activeElement === element;
},
};
};