import { ListItemSelectUniDriver } from '@wix/design-system/dist/testkit/unidriver';
import type { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../unidriver';

export const ViewsDropdownListItemUniDriver = (
  base: UniDriver,
  body: UniDriver,
) => {
  const viewsDropdownOptionDriverById = () =>
    ListItemSelectUniDriver(base, body);

  const click = () => viewsDropdownOptionDriverById().click();

  return {
    ...baseUniDriverFactory(base),
    ...viewsDropdownOptionDriverById(),
    click,
    select: click,
  };
};
