Skip to content

Commit

Permalink
add test for render markdown component
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Jun 13, 2024
1 parent b6f9598 commit 2176317
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { render, screen } from "@testing-library/react";
import { GovernanceActionCardElement } from "./GovernanceActionCardElement"; // Adjust the import path as per your file structure

describe("GovernanceActionCardElement", () => {
it("renders markdown content correctly", () => {
const label = "Example Label";
const markdownText = "**Bold**";

render(
<GovernanceActionCardElement
label={label}
text={markdownText}
isMarkdown
/>,
);

expect(screen.getByText(label)).toBeInTheDocument();
expect(screen.getByText("Bold")).toBeInTheDocument();

const strongElement = screen.getByText("Bold").closest("strong");
expect(strongElement).toBeInTheDocument();
});
});

0 comments on commit 2176317

Please sign in to comment.