DocSpace-client/packages/shared/components/link/Link.test.tsx

76 lines
3.0 KiB
TypeScript

import React from "react";
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import { Link, LinkType } from ".";
const baseProps = {
type: LinkType.page,
color: "black",
href: "https://github.com",
};
describe("<Link />", () => {
it("renders without error", () => {
render(<Link {...baseProps}>link</Link>);
expect(screen.queryByTestId("link")).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("with isBold prop", () => {
// const wrapper = mount(<Link {...baseProps} isBold />);
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
// expect(wrapper.prop("isBold")).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("with isHovered prop", () => {
// const wrapper = mount(<Link {...baseProps} isHovered />);
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
// expect(wrapper.prop("isHovered")).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("with isSemitransparent prop", () => {
// const wrapper = mount(<Link {...baseProps} isSemitransparent />);
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
// expect(wrapper.prop("isSemitransparent")).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("with type prop action", () => {
// const wrapper = mount(<Link {...baseProps} type="action" />);
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
// expect(wrapper.prop("type")).toEqual("action");
// });
// // @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(<Link {...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(<Link {...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(<Link {...baseProps} style={{ color: "red" }} />);
// // @ts-expect-error TS(2304): Cannot find name 'expect'.
// expect(wrapper.getDOMNode().style).toHaveProperty("color", "red");
// });
});