import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { RebootOTADialog } from "./RebootOTADialog.tsx"; import { ReactNode } from "react"; const rebootOtaMock = vi.fn(); let mockConnection: { rebootOta: (delay: number) => void } | undefined = { rebootOta: rebootOtaMock, }; vi.mock("@core/stores/deviceStore.ts", () => ({ useDevice: () => ({ connection: mockConnection, }), })); vi.mock("@components/UI/Button.tsx", async () => { const actual = await vi.importActual("@components/UI/Button.tsx"); return { ...actual, Button: (props) =>