import React from "react";
import renderer from "react-test-renderer";
import Avatar from "../Avatar";
import { WhatsNew } from "../../Icon/Icons";
jest.mock("../../Icon/Icon", () => ({ icon }: { icon: string | null }) =>
{icon}
);
jest.mock("../../Icon/CustomSvgIcon/CustomSvgIcon", () => () => );
const IMG_SRC =
"https://files.monday.com/use1/photos/16447897/small/16447897-Hadas_Farhi_photo_2020_10_04_10_14_06.png?1601806446";
const BADGE_SRC = "https://cdn7.monday.com/images/working-status/wfh.svg";
describe("Avatar renders correctly", () => {
it("renders correctly with empty props", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with image and text", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with image", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with not valid image", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with text", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly square avatar", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly an icon", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with badges", () => {
const tree = renderer
.create(
)
.toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly with damaged src badges", () => {
const tree = renderer
.create(
)
.toJSON();
expect(tree).toMatchSnapshot();
});
it("renders correctly accessibility props", () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
});