CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/misc/A.test.tsx
Views: 687
1
import A from "./A";
2
import renderer from "react-test-renderer";
3
4
test("some basic properties of A are correct so will open a new tab at right url", () => {
5
const component = renderer.create(<A href="https://cocalc.com">CoCalc</A>);
6
let tree = component.toJSON();
7
expect(tree.type).toBe("a");
8
expect(tree.props.target).toBe("_blank");
9
expect(tree.props.href).toBe("https://cocalc.com");
10
expect(tree.props.rel).toBe("noopener");
11
expect(tree.children).toEqual(["CoCalc"]);
12
});
13
14