import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { EmptyStateUniDriver } from './EmptyState.uni.driver';
import {
  ImageUniDriver,
  TextButtonUniDriver,
} from '@wix/design-system/dist/testkit/unidriver';

export function CollectionNoResultsStateUniDriver(
  base: UniDriver,
  body: UniDriver,
) {
  const { getButton, getImage, ...rest } = EmptyStateUniDriver(base, body);

  return {
    ...rest,
    /**
     * Get no results CTA button driver
     */
    getClearFiltersButton: () =>
      TextButtonUniDriver(
        base.$('[data-hook="empty-state-clear-filters-button"]'),
        body,
      ),
    /**
     * Get no results image
     */
    getImageGlassArt: () =>
      ImageUniDriver(
        base.$('[data-hook="empty-state-glass-illustration"]'),
        body,
      ),
  };
}
