mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 19:04:45 +00:00
test: guard voice call test lookups
This commit is contained in:
@@ -576,7 +576,9 @@ describe("MediaStreamHandler security hardening", () => {
|
||||
throw new Error("Expected websocket connection emit call");
|
||||
}
|
||||
expect(emitCall[0]).toBe("connection");
|
||||
expect(emitCall[1]).toBeDefined();
|
||||
if (!emitCall[1]) {
|
||||
throw new Error("Expected websocket connection argument");
|
||||
}
|
||||
const request = requireRecord(emitCall[2], "connection request");
|
||||
const socket = requireRecord(request.socket, "connection request socket");
|
||||
expect(socket.remoteAddress).toBe("127.0.0.1");
|
||||
|
||||
@@ -269,9 +269,11 @@ describe("generateVoiceResponse", () => {
|
||||
expect(resolveAgentWorkspaceDir).toHaveBeenCalledWith(coreConfig, "main");
|
||||
expect(resolveAgentIdentity).toHaveBeenCalledWith(coreConfig, "main");
|
||||
const defaultSessionEntry = sessionStore["voice:15550001111"];
|
||||
expect(defaultSessionEntry).toBeDefined();
|
||||
if (!defaultSessionEntry) {
|
||||
throw new Error("Expected default voice session entry");
|
||||
}
|
||||
expect(resolveSessionFilePath).toHaveBeenCalledWith(
|
||||
defaultSessionEntry?.sessionId,
|
||||
defaultSessionEntry.sessionId,
|
||||
defaultSessionEntry,
|
||||
{
|
||||
agentId: "main",
|
||||
@@ -317,9 +319,11 @@ describe("generateVoiceResponse", () => {
|
||||
expect(resolveAgentWorkspaceDir).toHaveBeenCalledWith(coreConfig, "voice");
|
||||
expect(resolveAgentIdentity).toHaveBeenCalledWith(coreConfig, "voice");
|
||||
const voiceSessionEntry = sessionStore["voice:15550001111"];
|
||||
expect(voiceSessionEntry).toBeDefined();
|
||||
if (!voiceSessionEntry) {
|
||||
throw new Error("Expected routed voice session entry");
|
||||
}
|
||||
expect(resolveSessionFilePath).toHaveBeenCalledWith(
|
||||
voiceSessionEntry?.sessionId,
|
||||
voiceSessionEntry.sessionId,
|
||||
voiceSessionEntry,
|
||||
{
|
||||
agentId: "voice",
|
||||
|
||||
Reference in New Issue
Block a user