From a77641e7d284160cee9607b709788fc22221728a Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 8 Nov 2023 09:24:29 +0100 Subject: [PATCH] extend query calls tests --- __tests__/call-members.test.ts | 10 ++++++++++ __tests__/call.test.ts | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/__tests__/call-members.test.ts b/__tests__/call-members.test.ts index aabfdbe..cf6b077 100644 --- a/__tests__/call-members.test.ts +++ b/__tests__/call-members.test.ts @@ -52,6 +52,16 @@ describe("call members API", () => { expect(response.members[2].role).toBe("user"); }); + it("query calls - filter by call members", async () => { + const response = await client.video.queryCalls({ + filter_conditions: { + members: { $in: ["sara"] }, + }, + }); + + expect(response.calls.length).toBeGreaterThanOrEqual(1); + }); + it("block and unblock users", async () => { const response = await call.blockUser({ user_id: "sara" }); diff --git a/__tests__/call.test.ts b/__tests__/call.test.ts index b1979da..7af5791 100644 --- a/__tests__/call.test.ts +++ b/__tests__/call.test.ts @@ -98,6 +98,24 @@ describe("call API", () => { expect(response.calls.length).toBeGreaterThanOrEqual(1); }); + it("query calls - ongoing", async () => { + const response = await client.video.queryCalls({ + filter_conditions: { ongoing: { $eq: true } }, + }); + + // Dummy test + expect(response.calls).toBeDefined(); + }); + + it("query calls - upcoming", async () => { + const response = await client.video.queryCalls({ + filter_conditions: { starts_at: { $gt: new Date().toISOString() } }, + }); + + // Dummy test + expect(response.calls).toBeDefined(); + }); + describe("recording", () => { it("enable call recording", async () => { let response = await call.update({