wix-style-react
Version:
wix-style-react
23 lines • 1.1 kB
JavaScript
export const dropdownLayoutDriverProxy = (drodpwnLayoutDummy, dropdownLayoutTestkit, popoverTestkit, inputTestkit) => {
return {
...Object.keys(drodpwnLayoutDummy()).reduce((prev, current) => {
return {
...prev,
[]: async (args) => {
const isPopoverShown = await (await popoverTestkit()).isContentElementExists();
if (current === 'isShown' || current === 'exists') {
return isPopoverShown;
}
if (current === 'getDropdown' || current === 'getDropdownItem') {
return isPopoverShown
? (await dropdownLayoutTestkit())[current](args)
: { isDisplayed: () => false };
}
!isPopoverShown && (await inputTestkit.click());
return await (await dropdownLayoutTestkit())[current](args);
},
};
}, {}),
};
};
//# sourceMappingURL=InputWithOptions.proxy.driver.js.map