/* eslint-disable react-native/no-inline-styles */
import React from "react";
import { render } from "@testing-library/react-native";
import { SecondaryImage } from "../Image";

describe("SecondaryImage - Image", () => {
  it("SecondaryImage should not render if no aspect ratio", async () => {
    const wrapper = await render(
      <SecondaryImage uri="" style={{ width: 100 }} />
    );

    expect(wrapper.toJSON()).toEqual(null);
    expect(wrapper.toJSON()).toMatchSnapshot();
  });

  it("SecondaryImage should render if known dimensions", async () => {
    const wrapper = await render(
      <SecondaryImage
        uri=""
        style={{ width: 100, height: 100, borderRadius: 10 }}
      />
    );

    expect(wrapper.toJSON()).not.toEqual(null);
    expect(wrapper.toJSON()).toMatchSnapshot();
  });
});
