From fcb6e729db31065bff468dd4336db0b69c6b0f70 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 4 Nov 2024 08:43:40 -0800 Subject: [PATCH] fix up the tests --- example/src/tests/groupPerformanceTests.ts | 4 ---- example/src/tests/groupTests.ts | 17 ++++++++++------- src/lib/Dm.ts | 1 - src/lib/types/GroupOptions.ts | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/example/src/tests/groupPerformanceTests.ts b/example/src/tests/groupPerformanceTests.ts index e610aaa70..a33f83b7d 100644 --- a/example/src/tests/groupPerformanceTests.ts +++ b/example/src/tests/groupPerformanceTests.ts @@ -180,10 +180,8 @@ test('testing large group listings with ordering', async () => { let start2 = Date.now() let groups2 = await alixClient.conversations.listGroups( { - members: false, consentState: false, description: false, - creatorInboxId: false, addedByInboxId: false, isActive: false, lastMessage: true, @@ -228,10 +226,8 @@ test('testing large group listings with ordering', async () => { start2 = Date.now() groups2 = await boClient.conversations.listGroups( { - members: false, consentState: false, description: false, - creatorInboxId: false, addedByInboxId: false, isActive: false, lastMessage: true, diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index 579ecd875..6ca8be5b2 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -556,7 +556,7 @@ test('can get members of a group', async () => { const [alixClient, boClient] = await createClients(2) const group = await alixClient.conversations.newGroup([boClient.address]) - const members = group.members + const members = await group.members() assert(members.length === 2, `Should be 2 members but was ${members.length}`) @@ -1936,7 +1936,7 @@ test('can allow and deny a inbox id', async () => { await bo.contacts.allowInboxes([alix.inboxId]) - let alixMember = (await boGroup.membersList()).find( + let alixMember = (await boGroup.members()).find( (member) => member.inboxId === alix.inboxId ) assert( @@ -1968,7 +1968,7 @@ test('can allow and deny a inbox id', async () => { await bo.contacts.denyInboxes([alix.inboxId]) - alixMember = (await boGroup.membersList()).find( + alixMember = (await boGroup.members()).find( (member) => member.inboxId === alix.inboxId ) assert( @@ -2266,10 +2266,13 @@ test('can create new installation without breaking group', async () => { await client1Group?.sync() await client2Group?.sync() - assert(client1Group?.members?.length === 2, `client 1 should see 2 members`) + assert( + (await client1Group?.members())?.length === 2, + `client 1 should see 2 members` + ) assert( - (await client2Group?.membersList())?.length === 2, + (await client2Group?.members())?.length === 2, `client 2 should see 2 members` ) @@ -2297,13 +2300,13 @@ test('can list many groups members in parallel', async () => { const groups: Group[] = await createGroups(alix, [bo], 20) try { - await Promise.all(groups.slice(0, 10).map((g) => g.membersList())) + await Promise.all(groups.slice(0, 10).map((g) => g.members())) } catch (e) { throw new Error(`Failed listing 10 groups members with ${e}`) } try { - await Promise.all(groups.slice(0, 20).map((g) => g.membersList())) + await Promise.all(groups.slice(0, 20).map((g) => g.members())) } catch (e) { throw new Error(`Failed listing 20 groups members with ${e}`) } diff --git a/src/lib/Dm.ts b/src/lib/Dm.ts index d61609838..e9d227265 100644 --- a/src/lib/Dm.ts +++ b/src/lib/Dm.ts @@ -15,7 +15,6 @@ import * as XMTP from '../index' export interface DmParams { id: string createdAt: number - creatorInboxId: InboxId topic: string consentState: ConsentState lastMessage?: DecodedMessage diff --git a/src/lib/types/GroupOptions.ts b/src/lib/types/GroupOptions.ts index f084ac944..5bfa36660 100644 --- a/src/lib/types/GroupOptions.ts +++ b/src/lib/types/GroupOptions.ts @@ -1,5 +1,4 @@ export type GroupOptions = { - creatorInboxId?: boolean isActive?: boolean addedByInboxId?: boolean name?: boolean