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