import * as React from "react";
import { render, press } from "reakit-test-utils";
import { Composite, CompositeProps } from "../Composite";
const props: CompositeProps = {
id: "composite",
items: [
{ id: "1", ref: { current: null } },
{ id: "2", ref: { current: null } },
{ id: "3", ref: { current: null } },
],
currentId: "2",
setCurrentId: jest.fn(),
first: jest.fn(),
last: jest.fn(),
move: jest.fn(),
};
test("render", () => {
const { container } = render();
expect(console).toHaveWarned();
expect(container).toMatchInlineSnapshot(`
`);
});
test("render aria-activedescendant", () => {
const { container } = render();
expect(console).toHaveWarned();
expect(container).toMatchInlineSnapshot(`
`);
});
test("render without state props", () => {
// @ts-ignore
const { container } = render();
expect(console).toHaveWarned();
expect(container).toMatchInlineSnapshot(`
`);
});
test("interact without state props", () => {
const { getByLabelText } = render(
// @ts-ignore
);
const composite = getByLabelText("composite");
press.Enter(composite);
});