diff --git a/frontend/__tests__/components/common/AnimatedModal.spec.tsx b/frontend/__tests__/components/common/AnimatedModal.spec.tsx index 6b6d3540fbb1..3eb79f9a145e 100644 --- a/frontend/__tests__/components/common/AnimatedModal.spec.tsx +++ b/frontend/__tests__/components/common/AnimatedModal.spec.tsx @@ -2,9 +2,11 @@ import { render } from "@solidjs/testing-library"; import { describe, it, expect, vi, beforeEach } from "vitest"; import { AnimatedModal } from "../../../src/ts/components/common/AnimatedModal"; +import { hideModal, ModalId, showModal } from "../../../src/ts/states/modals"; describe("AnimatedModal", () => { beforeEach(() => { + showModal("Support" as ModalId); vi.clearAllMocks(); // Mock dialog methods that don't exist in jsdom @@ -57,6 +59,13 @@ describe("AnimatedModal", () => { ).toHaveTextContent("Test Content"); }); + it("doesnt render children if not open", () => { + hideModal("Support" as ModalId); + const { modalDiv } = renderModal({}); + + expect(modalDiv).not.toBeInTheDocument(); + }); + it("has escape handler attached", () => { const { dialog } = renderModal({}); diff --git a/frontend/src/html/popups.html b/frontend/src/html/popups.html index 3ee31d09cc30..070c077fd933 100644 --- a/frontend/src/html/popups.html +++ b/frontend/src/html/popups.html @@ -1,12 +1,3 @@ - -