import { render } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import "@testing-library/jest-dom";
import { VuiSearchResult } from "./SearchResult";
describe("VuiSearchResult", () => {
describe("renders", () => {
test("all props", () => {
const { asFragment } = render(
subTitle}
className="customClass"
snippetProps={{
className: "snippetCustomClass"
}}
>
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
1
title
subTitle
children
`);
});
test("missing optional props", () => {
const { asFragment } = render(
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
`);
});
test("has title but missing url", () => {
const { asFragment } = render(
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
`);
});
test("missing title but has url", () => {
const { asFragment } = render(
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
`);
});
test("has empty title but has url", () => {
const { asFragment } = render(
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
`);
});
test("has empty title and empty url", () => {
const { asFragment } = render(
children
,
{ wrapper: MemoryRouter }
);
expect(asFragment()).toMatchInlineSnapshot(`
`);
});
});
});