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

export function DocumentViewUniDriver(base: UniDriver, _body: UniDriver) {
  return {
    ...baseUniDriverFactory(base),
    hasTag: () => base.$('[data-hook="cell-document-tag"]').exists(),
    getTagText: async () =>
      (await base.$('[data-hook="cell-document-tag"]').text()) ?? '',
    isEmpty: async () =>
      !(await base.$('[data-hook="cell-document-tag"]').exists()),
  };
}
