import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";

var _templateObject;

import * as React from 'react';
import { cleanup, render, screen } from '@testing-library/react';
import Skeleton from '../index';
describe('Skeleton', function () {
  afterEach(cleanup);
  test('should render with default props', function () {
    var _render = render( /*#__PURE__*/React.createElement(Skeleton, null)),
        container = _render.container;

    expect(container).toMatchSnapshot();
  });
  it('should render radius shape skeleton', function () {
    render( /*#__PURE__*/React.createElement(Skeleton, {
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton za-skeleton--radius');
  });
  test.each(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n    className            | shape       | expected\n    ", " | ", " | ", "\n    ", " | ", " | ", "\n    ", " | ", "   | ", "\n  "])), 'custom-skeleton', 'circle', 'za-skeleton za-skeleton--circle custom-skeleton', 'custom-skeleton', 'radius', 'za-skeleton za-skeleton--radius custom-skeleton', 'custom-skeleton', 'rect', 'za-skeleton za-skeleton--rect custom-skeleton')('should render with className - $className and shape - $shape', function (_ref) {
    var className = _ref.className,
        shape = _ref.shape,
        expected = _ref.expected;
    render( /*#__PURE__*/React.createElement(Skeleton, {
      "data-testid": "skeleton-root",
      className: className,
      shape: shape
    }));
    expect(screen.getByTestId('skeleton-root').className).toEqual(expected);
  });
  it('should render animated skeleton', function () {
    render( /*#__PURE__*/React.createElement(Skeleton, {
      animated: true,
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton za-skeleton--radius za-skeleton--animated');
  });
  it('should render Skeleton.Title', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Title, {
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton za-skeleton--radius za-skeleton__title');
  });
  it('should render rect Skeleton.Title', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Title, {
      shape: "rect",
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton za-skeleton--rect za-skeleton__title');
  });
  it('should render animated Skeleton.Title', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Title, {
      animated: true,
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton za-skeleton--radius za-skeleton--animated za-skeleton__title');
  });
  it('should render Skeleton.Paragraph', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Paragraph, {
      lineCount: 5,
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').className).toEqual('za-skeleton__paragraph');
    expect(screen.getByTestId('skeleton-root').firstElementChild.className).toEqual('za-skeleton za-skeleton--radius za-skeleton__line');
    expect(screen.getByTestId('skeleton-root').childElementCount).toBe(5);
  });
  it('should render animated Skeleton.Paragraph', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Paragraph, {
      animated: true,
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').firstElementChild.className).toEqual('za-skeleton za-skeleton--radius za-skeleton--animated za-skeleton__line');
  });
  it('should render rect Skeleton.Paragraph', function () {
    render( /*#__PURE__*/React.createElement(Skeleton.Paragraph, {
      shape: "rect",
      "data-testid": "skeleton-root"
    }));
    expect(screen.getByTestId('skeleton-root')).toBeTruthy();
    expect(screen.getByTestId('skeleton-root').firstElementChild.className).toEqual('za-skeleton za-skeleton--rect za-skeleton__line');
  });
});