"use strict";

exports.__esModule = true;
exports.default = exports.SummaryBarUniDriver = void 0;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
const SummaryBarUniDriver = async (base, body) => {
  const summaryBarBase = await base.get('[data-hook="summary-bar"]');
  const isSuccessState = async () => (await summaryBarBase.get('[data-hook="summary-bar-content"]')).exists();
  const isLoadingState = async () => (await summaryBarBase.get('[data-hook="skeleton-summary-bar"]')).exists();
  const isErrorState = async () => (await summaryBarBase.get('[data-hook="error-summary-bar"]')).exists();
  const getRetryButton = async () => (0, _unidriver.TextButtonUniDriver)(await summaryBarBase.get('[data-hook="summary-bar-retry-button"]'), body);
  const getErrorText = async () => (0, _unidriver.TextUniDriver)(await summaryBarBase.get('[data-hook="summary-bar-error-text"]'), body);
  const getItemTextAt = async index => (await summaryBarBase.getAll('[data-hook="summary-bar-item"]')).at(index).text();
  return {
    ...summaryBarBase,
    /** Is SummaryBar in success state */
    isSuccessState,
    /** Is SummaryBar in loading state */
    isLoadingState,
    /** Is SummaryBar in error state */
    isErrorState,
    /**  Gets retry button text */
    getRetryButton,
    /**  Gets error text */
    getErrorText,
    getItemTextAt
  };
};
exports.SummaryBarUniDriver = SummaryBarUniDriver;
var _default = exports.default = SummaryBarUniDriver;
//# sourceMappingURL=SummaryBar.uni.driver.js.map