"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _react = _interopRequireDefault(require("react"));

var _react2 = require("@testing-library/react");

var _index = _interopRequireDefault(require("../index"));

describe('Progress', function () {
  it('renders correctly', function () {
    var _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      percent: 10
    })),
        container = _render.container;

    expect(container).toMatchSnapshot();
  });
  it('renders has children correctly', function () {
    var _render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      percent: 10
    }, "foo")),
        container = _render2.container;

    expect(container).toMatchSnapshot();
  });
  describe('circle shape progress', function () {
    it('renders shape is circle correctly', function () {
      var _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "circle",
        strokeShape: "rect",
        percent: 10
      }, "foo")),
          container = _render3.container;

      expect(container).toMatchSnapshot();
    });
    it('renders shape is semi-circle correctly', function () {
      var _render4 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "semi-circle",
        percent: 10
      }, "foo")),
          container = _render4.container;

      expect(container).toMatchSnapshot();
    });
    it('renders percent correctly', function () {
      var _render5 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "circle",
        percent: 10,
        text: function text(percent) {
          return /*#__PURE__*/_react.default.createElement("div", {
            className: "test-progress"
          }, percent);
        }
      })),
          container = _render5.container;

      expect(container.querySelectorAll('.test-progress')[0].textContent).toEqual('10');
      expect(container).toMatchSnapshot();
    });
  });
  describe('line shape progress', function () {
    it('renders size is lg correctly', function () {
      var _render6 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "line",
        percent: 10,
        size: "lg"
      })),
          container = _render6.container;

      expect(container.querySelectorAll('.za-progress--lg')).toHaveLength(1);
      expect(container).toMatchSnapshot();
    });
    it('renders size is md correctly', function () {
      var _render7 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "line",
        percent: 10,
        size: "md"
      })),
          container = _render7.container;

      expect(container.querySelectorAll('.za-progress--md')).toHaveLength(1);
      expect(container).toMatchSnapshot();
    });
    it('renders size is sm correctly', function () {
      var _render8 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
        shape: "line",
        percent: 10,
        size: "sm"
      })),
          container = _render8.container;

      expect(container.querySelectorAll('.za-progress--sm')).toHaveLength(1);
      expect(container).toMatchSnapshot();
    });
  });
});