/* 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 uri", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage should not render if no aspect ratio (dynamic)", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage should render if known dimensions", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).not.toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage should render in fixed mode without image until loaded", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage should not render in dynamic mode without image", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage should render in fixed mode with known dimensions", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).not.toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
it("SecondaryImage dynamic mode should call onAsyncRender when provided", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).not.toEqual(null);
});
it("SecondaryImage fixed mode should not use async render props", async () => {
const wrapper = await render(
);
expect(wrapper.toJSON()).not.toEqual(null);
expect(wrapper.toJSON()).toMatchSnapshot();
});
});