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

export default (base: UniDriver, body: UniDriver) => {
  const getLoadingCardHeader = () =>
    CardHeaderUniDriver(base.$('[data-hook="skeleton-card-header"]'), body);

  return {
    ...baseUniDriverFactory(base),
    showsSkeletonHeader: () => getLoadingCardHeader().exists(),
  };
};
