/* @vitest-environment jsdom */ import { render } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; const appConfiguratorPanelMock = vi.fn((props: unknown) => props); vi.mock("@/modules/apps/components/configurator/app-configurator-panel", () => ({ AppConfiguratorPanel: (props: unknown) => { appConfiguratorPanelMock(props); return null; }, })); import { AppSettingsPanel } from "@/modules/apps/components/configurator/app-settings-panel"; describe("AppSettingsPanel wrapper", () => { it("maps target usage to installed_edit context", () => { render( , ); expect(appConfiguratorPanelMock).toHaveBeenCalledWith( expect.objectContaining({ context: "installed_edit", }), ); }); it("maps template usage to catalog_install context", () => { render( , ); expect(appConfiguratorPanelMock).toHaveBeenCalledWith( expect.objectContaining({ context: "catalog_install", }), ); }); it("defaults to custom_install context when no target/template", () => { render(); expect(appConfiguratorPanelMock).toHaveBeenCalledWith( expect.objectContaining({ context: "custom_install", }), ); }); });