// frontend/tests/inbox/CaptureComposer.mm.test.tsx — 멀티모달 폴백
import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import CaptureComposer from "@/components/inbox/CaptureComposer";

describe("CaptureComposer 멀티모달 폴백", () => {
  it("getUserMedia 미지원 → voice 폴백 문구로 제출", () => {
    // jsdom 환경: navigator.mediaDevices 미정의
    const onSubmit = vi.fn();
    render(<CaptureComposer onSubmit={onSubmit} />);
    fireEvent.click(screen.getByLabelText("음성으로 캡처"));
    expect(onSubmit).toHaveBeenCalledWith(
      expect.stringContaining("텍스트로 적어주세요"),
      "voice",
    );
  });
});
