UNPKG

@netdata/charts

Version:

Netdata frontend SDK and chart utilities

48 lines 1.36 kB
import React from "react"; import { screen } from "@testing-library/react"; import "@testing-library/jest-dom"; import { renderWithChart } from "@jest/testUtilities"; import Drawer from "./index"; import { actions } from "./constants"; import { jsx as _jsx } from "react/jsx-runtime"; describe("Drawer", function () { it("lets the values table own vertical scrolling", function () { renderWithChart(/*#__PURE__*/_jsx(Drawer, {}), { attributes: { drawer: { action: actions.values } } }); expect(screen.getByTestId("drawer-content")).toHaveStyle({ minHeight: "0px", overflowY: "hidden" }); }); it("lets the drill-down table own vertical scrolling", function () { renderWithChart(/*#__PURE__*/_jsx(Drawer, {}), { attributes: { drawer: { action: actions.drillDown } } }); expect(screen.getByTestId("drawer-content")).toHaveStyle({ minHeight: "0px", overflowY: "hidden" }); }); it("keeps drawer scrolling for non-table actions", function () { renderWithChart(/*#__PURE__*/_jsx(Drawer, {}), { attributes: { drawer: { action: actions.compare } } }); expect(screen.getByTestId("drawer-content")).toHaveStyle({ minHeight: "0px", overflowY: "scroll" }); }); });