test(FN-712): add regression test for modal overlay 'open' class visibility

- Add ScriptsModal test verifying overlay gets 'open' class when modal is shown
- Ensures modal visibility state is correctly reflected in DOM class list
This commit is contained in:
gsxdsm
2026-04-02 18:37:08 -07:00
parent 743dec5494
commit 91fabbce74

View File

@@ -30,6 +30,18 @@ beforeEach(() => {
});
describe("ScriptsModal", () => {
it("has the 'open' class on the modal overlay when visible", async () => {
vi.mocked(fetchScripts).mockResolvedValueOnce(mockScripts);
render(
<ScriptsModal isOpen={true} onClose={onClose} addToast={addToast} onRunScript={onRunScript} />
);
const overlay = screen.getByTestId("scripts-modal");
expect(overlay.classList.contains("modal-overlay")).toBe(true);
expect(overlay.classList.contains("open")).toBe(true);
});
it("does not render when closed", () => {
const { container } = render(
<ScriptsModal isOpen={false} onClose={onClose} addToast={addToast} onRunScript={onRunScript} />