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

export function ImageViewUniDriver(base: UniDriver, _body: UniDriver) {
  return {
    ...baseUniDriverFactory(base),
    hasThumbnail: () => base.$('[data-hook="image-thumbnail"]').exists(),
    isEmpty: async () => {
      const thumbnail = base.$('[data-hook="image-thumbnail"]');
      return (await thumbnail.attr('data-empty')) === 'true';
    },
  };
}
