squiggle/packages/components/test/number.test.tsx
2022-10-12 14:45:08 +11:00

17 lines
519 B
TypeScript

import { render } from "@testing-library/react";
import React from "react";
import "@testing-library/jest-dom";
import { SquiggleChart } from "../src/index";
test("Precision", async () => {
const { container: highPrecision } = render(
<SquiggleChart code={"1.25476"} numberPrecision={5} />
);
expect(highPrecision).toHaveTextContent("1.2548");
const { container: lowPrecision } = render(
<SquiggleChart code={"1.25476"} numberPrecision={2} />
);
expect(lowPrecision).toHaveTextContent("1.3");
});