UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

25 lines 1.57 kB
import React from "react"; import { renderWithProviders, screen } from "testUtilities"; import AlertMasterCard from "./alertMastercard"; describe("MasterCardPill component", function () { test("should render default component", function () { renderWithProviders(/*#__PURE__*/React.createElement(AlertMasterCard, null)); expect(screen.queryByTestId("alert-mastercard")).toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-icon-pill")).toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-left-pill")).toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-right-pill")).toBeInTheDocument(); }); test("should render component with custom test id", function () { renderWithProviders(/*#__PURE__*/React.createElement(AlertMasterCard, { "data-testid": "custom-alert-mastercard" })); expect(screen.queryByTestId("alert-mastercard")).not.toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-icon-pill")).not.toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-left-pill")).not.toBeInTheDocument(); expect(screen.queryByTestId("alert-mastercard-right-pill")).not.toBeInTheDocument(); expect(screen.queryByTestId("custom-alert-mastercard")).toBeInTheDocument(); expect(screen.queryByTestId("custom-alert-mastercard-icon-pill")).toBeInTheDocument(); expect(screen.queryByTestId("custom-alert-mastercard-left-pill")).toBeInTheDocument(); expect(screen.queryByTestId("custom-alert-mastercard-right-pill")).toBeInTheDocument(); }); });