73 lines
3.1 KiB
TypeScript
73 lines
3.1 KiB
TypeScript
import React from "react";
|
|
|
|
import { render, screen } from "@testing-library/react";
|
|
import "@testing-library/jest-dom";
|
|
|
|
import { Checkbox } from "./Checkbox";
|
|
|
|
describe("<Checkbox />", () => {
|
|
it("renders without error", () => {
|
|
render(<Checkbox isIndeterminate={false} name="checkbox" />);
|
|
|
|
expect(screen.getByTestId("checkbox")).toBeInTheDocument();
|
|
});
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts id", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} id="testId" />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("id")).toEqual("testId");
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts className", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} className="test" />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("className")).toEqual("test");
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts style", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} style={{ color: "red" }} />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.getDOMNode().style).toHaveProperty("color", "red");
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts isDisabled", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} isDisabled />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("isDisabled")).toEqual(true);
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts isIndeterminate", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} isIndeterminate />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("isIndeterminate")).toEqual(true);
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts isChecked", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} isChecked />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("isChecked")).toEqual(true);
|
|
// });
|
|
|
|
// // @ts-expect-error TS(2582): Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
|
// it("accepts isChecked and isDisabled", () => {
|
|
// const wrapper = mount(<Checkbox {...baseProps} isChecked isDisabled />);
|
|
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("isChecked")).toEqual(true);
|
|
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
|
|
// expect(wrapper.prop("isDisabled")).toEqual(true);
|
|
// });
|
|
});
|