import React from "react";
import { render } from "@testing-library/react-native";
import { ThemeProvider } from "../../theme/src/theme-context";
import { allStyleFunctions } from "../../theme/src/style-functions";
import { useMotiWithStyleProps } from "../useMotiWithStyleProps";
import { MotiView } from "moti";
jest.useFakeTimers();
const TestComponent = props => {
  const rest = useMotiWithStyleProps(props.object, allStyleFunctions);
  return /*#__PURE__*/React.createElement(MotiView, rest);
};
describe("useMotiWithStyleProps", () => {
  it("transforms Moti 'from' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(TestComponent, {
      object: {
        from: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'animate' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(TestComponent, {
      object: {
        animate: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'exit' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(TestComponent, {
      object: {
        exit: {
          backgroundColor: "pink",
          p: "s"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'transition' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(TestComponent, {
      object: {
        transition: {
          type: "timing"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'exitTransition' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(TestComponent, {
      object: {
        exitTransition: {
          type: "timing"
        }
      }
    })));
    const tree = comp.toJSON();
    expect(tree).toMatchSnapshot();
  });
  it("transforms Moti 'state' props correctly", () => {
    const comp = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.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