/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { render, screen } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import BarChartWidget from "../BarChartWidget";
test("renders the chart title", async () => {
render(
,
{ wrapper: MemoryRouter },
);
expect(screen.getByText("test title")).toBeInTheDocument();
});
test("renders chart summary above the chart", async () => {
render(
,
{ wrapper: MemoryRouter },
);
const summary = screen.getByText("test summary");
expect(summary).toBeInTheDocument();
expect(summary.closest("div")).toHaveClass("chartSummaryAbove");
});
test("renders chart summary below the chart", async () => {
render(
,
{ wrapper: MemoryRouter },
);
const summary = screen.getByText("test summary");
expect(summary).toBeInTheDocument();
expect(summary.closest("div")).toHaveClass("chartSummaryBelow");
});