import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../../../unidriver';

export function ReferenceViewUniDriver(base: UniDriver, _body: UniDriver) {
  return {
    ...baseUniDriverFactory(base),
    isEmpty: async () =>
      !(await base.$('[data-hook="reference-view"]').exists()),
    getName: () => base.$('[data-hook="reference-view"]').text(),
    hasAvatar: () =>
      base.$('[data-hook="reference-view"] [data-hook="avatar"]').exists(),
  };
}
