import React from "react"; import { act, create, type ReactTestRenderer } from "react-test-renderer"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import JVMResourceBrowser from "./JVMResourceBrowser"; import type { JVMValueSnapshot } from "../types"; const storeState = vi.hoisted(() => ({ connections: [ { id: "conn-jvm-writable", name: "orders-jvm", config: { host: "127.0.0.1", user: "jmx-user", port: 9010, type: "jvm", jvm: { preferredMode: "jmx", readOnly: false, jmx: { password: "initial-jmx-secret", }, }, }, }, ], addTab: vi.fn(), aiPanelVisible: false, setAIPanelVisible: vi.fn(), theme: "light", })); const backendApp = vi.hoisted(() => ({ JVMGetValue: vi.fn(), JVMPreviewChange: vi.fn(), JVMApplyChange: vi.fn(), })); vi.mock("@monaco-editor/react", () => ({ default: ({ value }: { value?: string }) =>
{value}
, })); vi.mock("@ant-design/icons", () => ({ FileSearchOutlined: () => , ReloadOutlined: () => , RobotOutlined: () => , })); vi.mock("antd", () => { const Text = ({ children }: any) => {children}; const Button = ({ children, disabled, loading, onClick, type, ...rest }: any) => ( ); const Card = ({ children, title }: any) => (

{title}

{children}
); const Descriptions: any = ({ children }: any) =>
{children}
; Descriptions.Item = ({ children, label }: any) => (
{label}
{children}
); const Input: any = ({ value, onChange, placeholder }: any) => ( ); Input.TextArea = ({ value, onChange }: any) => (