import { createRef, type ReactNode } from "react"; import { act, cleanup, render, screen } from "@testing-library/react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { TooltipProvider } from "@kandev/ui/tooltip"; import { TaskFormInputs } from "./task-create-dialog-selectors"; import type { TaskFormInputsHandle } from "./task-create-dialog-types"; // Capture the props (notably `onTranscript` / `onAutoSend`) that // TaskFormInputs hands the voice button so we can drive transcripts // without instantiating the real VoiceInputButton (which subscribes to // the user-settings store and instantiates voice engines). type VoiceProps = { onTranscript: (text: string) => void; onAutoSend?: () => void; disabled?: boolean; }; const voiceCalls: VoiceProps[] = []; vi.mock("@/components/task/chat/voice-input-button", () => ({ VoiceInputButton: (props: VoiceProps) => { voiceCalls.push(props); return