@@ -18,4 +18,20 @@ describe("Modal component", () => {
1818 );
1919 expect(modalContent).toBeInTheDocument();
2020 });
21+
22+ it("renders only the button", async () => {
23+ render(
24+ <Modal openButton={<button>open</button>} showModal={false}>
25+ <p>Modal content should be visible</p>
26+ </Modal>,
27+ );
28+
29+ const openButton = await screen.findByText("open");
30+ expect(openButton).toBeInTheDocument();
31+
32+ const modalContent = await screen.queryByText(
33+ "Modal content should be visible",
34+ );
35+ expect(modalContent).toBeNull();
36+ });
2137 });