text: "use strict";
  
  var _react = _interopRequireDefault(require("react"));
  
  var _constants = require("../constants");
  
  var _ = require("..");
  
  var _testing = require("../utils/testing");
  
  var _react2 = require("@testing-library/react");
  
  var _jestAxe = require("jest-axe");
  
  require("babel-polyfill");
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  expect.extend(_jestAxe.toHaveNoViolations);
  describe('position components', () => {
    describe('Absolute', () => {
      (0, _testing.behavesAsComponent)({
        Component: _.Absolute,
        systemPropArray: [_constants.LAYOUT, _constants.POSITION]
      });
      (0, _testing.checkExports)('Position', {
        default: _.Position,
        Absolute: _.Absolute,
        Fixed: _.Fixed,
        Relative: _.Relative,
        Sticky: _.Sticky
      });
      it('should have no axe violations', async () => {
        const {
          container
        } = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.Absolute, null));
        const results = await (0, _jestAxe.axe)(container);
        expect(results).toHaveNoViolations();
        (0, _react2.cleanup)();
      });
      it('sets position: absolute', () => {
        expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Absolute, null))).toHaveStyleRule('position', 'absolute');
      });
      it('can render other components with the as prop', () => {
        const result = (0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Absolute, {
          as: _.Box,
          borderWidth: "1px",
          borderStyle: "solid",
          borderColor: "border.primary",
          borderRadius: 2
        }));
        expect(result).toHaveStyleRule('position', 'absolute');
        expect(result).toHaveStyleRule('border-width', '1px');
        expect(result).toHaveStyleRule('border-style', 'solid');
      });
    });
    describe('Fixed', () => {
      (0, _testing.behavesAsComponent)({
        Component: _.Fixed,
        systemPropArray: [_constants.LAYOUT, _constants.POSITION]
      });
      it('respects the "as" prop', () => {
        expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Fixed, {
          as: "span"
        })).type).toEqual('span');
      });
      it('should have no axe violations', async () => {
        const {
          container
        } = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.Fixed, null));
        const results = await (0, _jestAxe.axe)(container);
        expect(results).toHaveNoViolations();
        (0, _react2.cleanup)();
      });
      it('sets position: fixed', () => {
        expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Fixed, null))).toHaveStyleRule('position', 'fixed');
      });
      it('can render other components with the as prop', () => {
        const result = (0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Fixed, {
          as: _.Box,
          borderWidth: "1px",
          borderStyle: "solid",
          borderColor: "border.primary",
          borderRadius: 2
        }));
        expect(result).toHaveStyleRule('position', 'fixed');
        expect(result).toHaveStyleRule('border-width', '1px');
        expect(result).toHaveStyleRule('border-style', 'solid');
      });
    });
    describe('Relative', () => {
      (0, _testing.behavesAsComponent)({
        Component: _.Relative,
        systemPropArray: [_constants.LAYOUT, _constants.POSITION]
      });
      it('should have no axe violations', async () => {
        const {
          container
        } = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.Relative, null));
        const results = await (0, _jestAxe.axe)(container);
        expect(results).toHaveNoViolations();
        (0, _react2.cleanup)();
      });
      it('sets position: relative', () => {
        expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Relative, null))).toHaveStyleRule('position', 'relative');
      });
      it('can render other components with the as prop', () => {
        const result = (0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Relative, {
          as: _.Box,
          borderWidth: "1px",
          borderStyle: "solid",
          borderColor: "border.primary",
          borderRadius: 2
        }));
        expect(result).toHaveStyleRule('position', 'relative');
        expect(result).toHaveStyleRule('border-width', '1px');
        expect(result).toHaveStyleRule('border-style', 'solid');
      });
    });
    describe('Sticky', () => {
      (0, _testing.behavesAsComponent)({
        Component: _.Sticky,
        systemPropArray: [_constants.LAYOUT, _constants.POSITION]
      });
      it('should have no axe violations', async () => {
        const {
          container
        } = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.Sticky, null));
        const results = await (0, _jestAxe.axe)(container);
        expect(results).toHaveNoViolations();
        (0, _react2.cleanup)();
      });
      it('sets position: sticky', () => {
        expect((0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Sticky, null))).toHaveStyleRule('position', 'sticky');
      });
      it('can render other components with the as prop', () => {
        const result = (0, _testing.render)( /*#__PURE__*/_react.default.createElement(_.Sticky, {
          as: _.Box,
          borderWidth: "1px",
          borderStyle: "solid",
          borderColor: "border.primary",
          borderRadius: 2
        }));
        expect(result).toHaveStyleRule('position', 'sticky');
        expect(result).toHaveStyleRule('border-width', '1px');
        expect(result).toHaveStyleRule('border-style', 'solid');
      });
    });
  });