Skip to content

Commit 02f7aed

Browse files
committed
voice-call(msteams): fix test-types on the new send/status changes
- msteams-realtime.test.ts: the mock session's `send` returns boolean (was the number from Array.push) now that MsteamsSession.send reports delivery - msteams.test.ts: the getCallStatus realtime test reads the provider from setup()'s non-undefined return instead of the module-level optional
1 parent b219291 commit 02f7aed

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

extensions/voice-call/src/msteams-realtime.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ function createMockSession(recordingStatus: MsteamsSession["recordingStatus"] =
4848
threadId: "thread-1",
4949
caller: { aadId: "aad-1", displayName: "Caller", tenantId: "tenant-1" },
5050
recordingStatus,
51-
send: (message) => sent.push(message),
51+
send: (message) => {
52+
sent.push(message);
53+
return true;
54+
},
5255
close: (reason) => {
5356
closedReason = reason;
5457
},

extensions/voice-call/src/providers/msteams.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,11 @@ describe("MsteamsProvider (audio loop wiring)", () => {
971971
});
972972

973973
it("getCallStatus reports in-progress for an active realtime call (no streaming `calls` state)", async () => {
974-
const { port } = await setup();
974+
const { port, provider: msProvider } = await setup();
975975
// Realtime calls live only in `realtimeCalls`; without the realtime check getCallStatus would
976976
// report them terminal and the manager would reap an active outbound callback on restore.
977977
const realtime = createMockRealtimeProvider();
978-
provider.setRealtimeRuntime({
978+
msProvider.setRealtimeRuntime({
979979
provider: realtime.plugin,
980980
providerConfig: {} as never,
981981
inboundPolicy: "open",
@@ -994,7 +994,7 @@ describe("MsteamsProvider (audio loop wiring)", () => {
994994
);
995995
await waitFor(() => realtime.created());
996996

997-
const status = await provider.getCallStatus({ providerCallId: callId });
997+
const status = await msProvider.getCallStatus({ providerCallId: callId });
998998
expect(status.status).toBe("in-progress");
999999
expect(status.isTerminal).toBe(false);
10001000

0 commit comments

Comments
 (0)