import * as React from "react"; import { render } from "reakit-test-utils"; import { Menu } from "../Menu"; function createRef(id: string) { const ref = React.createRef() as React.MutableRefObject; ref.current = document.createElement("div"); ref.current.id = id; return ref; } const props: Parameters[0] = { baseId: "base", items: [ { id: "a", ref: createRef("a") }, { id: "b", ref: createRef("b") }, ], setCurrentId: jest.fn(), move: jest.fn(), next: jest.fn(), previous: jest.fn(), first: jest.fn(), last: jest.fn(), placement: "bottom-start", "aria-label": "menu", }; test("render", () => { const { baseElement } = render(); expect(baseElement).toMatchInlineSnapshot(`
`); }); test("render without state props", () => { // @ts-ignore const { baseElement } = render(); expect(baseElement).toMatchInlineSnapshot(`
`); });