import { describe, expect, test } from "bun:test";
import { XaiGrokVoiceProvider } from "./xai-grok-voice.ts";

describe("XaiGrokVoiceProvider", () => {
  test("blocks PHI use until explicitly enabled", async () => {
    const provider = new XaiGrokVoiceProvider({
      apiKey: "xai-test",
      model: "grok-voice-think-fast-1.0",
      phiAllowed: false,
    });

    await expect(
      provider.connect({
        callId: "call-1",
        instructions: "hello",
        inputFormat: { codec: "pcm16", sampleRateHz: 16000, channels: 1 },
        outputFormat: { codec: "pcm16", sampleRateHz: 16000, channels: 1 },
        tools: [],
        events: {},
      }),
    ).rejects.toThrow(/not enabled for PHI/);
  });
});
