Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const statesButtonDriverFactory = (
base: UniDriver,
): StatesButtonDriver => {
const stylableUtil = new StylableUnidriverUtil(style);
return {
...buttonNextDriverFactory(base),
checkIconExists: () => base.$('[data-hook="checkIcon"]').exists(),
};
};
export const buttonDriverFactory = (base: UniDriver): ButtonDriver => {
const stylableUtil = new StylableUnidriverUtil(style);
return {
...buttonNextDriverFactory(base),
isFullWidth: async () => stylableUtil.hasStyleState(base, 'fullWidth'),
isMobile: async () => stylableUtil.hasStyleState(base, 'mobile'),
};
};
export const textButtonDriverFactory = (base: UniDriver): TextButtonDriver => {
const stylableUtil = new StylableUnidriverUtil(style);
return {
...buttonNextDriverFactory(base),
isMobile: async () => stylableUtil.hasStyleState(base, 'mobile'),
hasPriority: async (priority: TEXT_BUTTON_PRIORITY) =>
(await stylableUtil.getStyleState(base, 'priority')) === priority,
};
};