"use strict";

var _react = _interopRequireDefault(require("react"));
var _reactNative = require("@testing-library/react-native");
var _themeContext = require("../../theme/src/theme-context");
var _styleFunctions = require("../../theme/src/style-functions");
var _useMotiWithStyleProps = require("../useMotiWithStyleProps");
var _moti = require("moti");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
jest.useFakeTimers();
const TestComponent = props => {
  const rest = (0, _useMotiWithStyleProps.useMotiWithStyleProps)(props.object, _styleFunctions.allStyleFunctions);
  return /*#__PURE__*/_react.default.createElement(_moti.MotiView, rest);
};
describe("useMotiWithStyleProps", () => {
  it("transforms Moti 'from' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        from: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'animate' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        animate: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'exit' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        exit: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'transition' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        transition: {
          type: "timing"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'exitTransition' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        exitTransition: {
          type: "timing"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'state' props correctly", () => {
    const comp = (0, _reactNative.render)( /*#__PURE__*/_react.default.createElement(_themeContext.ThemeProvider, null, /*#__PURE__*/_react.default.createElement(TestComponent, {
      object: {
        state: {
          from: {
            backgroundColor: "pink",
            p: "s"
          },
          to: {
            backgroundColor: "silver",
            p: "xs"
          }
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
});
//# sourceMappingURL=useMotiWithStyleProps.spec.js.map