@uva-glass/component-library
Version:
React components UvA
67 lines (66 loc) • 2.94 kB
JavaScript
import { jsx as o } from "react/jsx-runtime";
import "../../index-dmBn99rF.js";
import { r as u, s as e, f as c } from "../../react.esm-DI5ilWeT.js";
import { createRef as s } from "react";
import { MenuButton as r } from "./MenuButton.js";
const n = jest.fn();
describe("LinkButton", () => {
it("should render", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "primary", onClick: n, buttonRef: t, children: "Test MenuButton" })
), expect(e.getByText("Test MenuButton")).toBeInTheDocument();
}), it("should render primary", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "primary", onClick: n, buttonRef: t, children: "Test MenuButton" })
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--primary");
}), it("should render secondary", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "secondary", onClick: n, buttonRef: t, children: "Test MenuButton" })
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--secondary");
}), it("should render destructive-primary", () => {
const t = s();
u(
/* @__PURE__ */ o(
r,
{
variant: "destructive-primary",
onClick: n,
buttonRef: t,
children: "Test MenuButton"
}
)
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--destructive-primary");
}), it("should render destructive-secondary", () => {
const t = s();
u(
/* @__PURE__ */ o(
r,
{
variant: "destructive-secondary",
onClick: n,
buttonRef: t,
children: "Test MenuButton"
}
)
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--destructive-secondary");
}), it("should render blank", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "blank", onClick: n, buttonRef: t, children: "Test MenuButton" })
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--blank");
}), it("should render blank-icon", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "blank-icon", onClick: n, buttonRef: t, children: "Test MenuButton" })
), expect(e.getByText("Test MenuButton")).toBeInTheDocument(), expect(e.getByText("Test MenuButton")).toHaveClass("button--blank-icon");
}), it("should fire when clicked", () => {
const t = s();
u(
/* @__PURE__ */ o(r, { variant: "blank-icon", onClick: n, buttonRef: t, children: "Test MenuButton" })
), c.click(e.getByText("Test MenuButton")), expect(n).toHaveBeenCalledTimes(1);
});
});
//# sourceMappingURL=MenuButton.test.js.map