import { render } from "@testing-library/react-native"; import React from "react"; import BarGraph from "../../src/component/charts/bar-graph/bar-graph"; import ChartContainer from "../../src/component/charts/container/chart-container"; import LineGraph from "../../src/component/charts/line-graph/line-graph"; import { graph_data_two_measures, line_chart_two_y_data, } from "../mock/charts/mock-data"; describe("ChartContainer Component Tests", () => { it("renders correctly with data -- line graph", () => { const { getByTestId } = render( , ); expect(getByTestId(`chart-container-1`)).toBeTruthy(); }); it("renders correctly with data -- bar graph", () => { const { getByTestId } = render( , ); expect(getByTestId(`chart-container-1`)).toBeTruthy(); }); it("does not render without data props", () => { // Have to ts-ignore to test null data conditions // @ts-ignore const { queryByTestId } = render(); expect(queryByTestId(`chart-container-2`)).toBeNull(); }); });