test: tighten voice call config assertions

This commit is contained in:
Peter Steinberger
2026-05-09 21:22:09 +01:00
parent 39fe6977a3
commit 1b24dacff2
2 changed files with 26 additions and 18 deletions

View File

@@ -34,22 +34,32 @@ describe("voice-call config compatibility", () => {
},
});
expect(normalized).toMatchObject({
streaming: {
enabled: true,
provider: "openai",
providers: {
openai: {
apiKey: "sk-test",
model: "gpt-4o-transcribe",
silenceDurationMs: 700,
vadThreshold: 0.4,
},
},
},
const streaming = normalized.streaming as
| {
enabled?: boolean;
provider?: string;
providers?: {
openai?: {
apiKey?: string;
model?: string;
silenceDurationMs?: number;
vadThreshold?: number;
};
};
openaiApiKey?: unknown;
sttModel?: unknown;
}
| undefined;
expect(streaming?.enabled).toBe(true);
expect(streaming?.provider).toBe("openai");
expect(streaming?.providers?.openai).toEqual({
apiKey: "sk-test",
model: "gpt-4o-transcribe",
silenceDurationMs: 700,
vadThreshold: 0.4,
});
expect((normalized.streaming as Record<string, unknown>).openaiApiKey).toBeUndefined();
expect((normalized.streaming as Record<string, unknown>).sttModel).toBeUndefined();
expect(streaming?.openaiApiKey).toBeUndefined();
expect(streaming?.sttModel).toBeUndefined();
});
it("reports doctor-oriented legacy issues and warnings", () => {

View File

@@ -27,8 +27,6 @@ describe("voice mapping", () => {
expect(isOpenAiVoice("nova")).toBe(true);
expect(isOpenAiVoice("NOVA")).toBe(true);
expect(isOpenAiVoice("Polly.Joanna")).toBe(false);
expect(getOpenAiVoiceNames()).toEqual(
expect.arrayContaining(["alloy", "echo", "fable", "nova", "onyx", "shimmer"]),
);
expect(getOpenAiVoiceNames()).toEqual(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]);
});
});