mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
20 lines
454 B
TypeScript
20 lines
454 B
TypeScript
import * as React from "react";
|
|
import {render} from "@testing-library/react";
|
|
|
|
import {Switch} from "../src";
|
|
|
|
describe("Switch", () => {
|
|
it("should render correctly", () => {
|
|
const wrapper = render(<Switch />);
|
|
|
|
expect(() => wrapper.unmount()).not.toThrow();
|
|
});
|
|
|
|
it("ref should be forwarded", () => {
|
|
const ref = React.createRef<HTMLDivElement>();
|
|
|
|
render(<Switch ref={ref} />);
|
|
expect(ref.current).not.toBeNull();
|
|
});
|
|
});
|