From 050a7734ebfab78c8ed22a63df2e156533a2fef0 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 3 Jun 2024 00:40:08 -0700 Subject: [PATCH] write a test for it --- example/src/tests/groupTests.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index 1620bab3d..34277e9c9 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -239,6 +239,26 @@ test('who added me to a group', async () => { return true }) +test('can get members of a group', async () => { + const [alixClient, boClient] = await createClients(2) + const group = await alixClient.conversations.newGroup([boClient.address]) + + const members = await group.members() + + assert(members.length === 2, `Should be 2 members but was ${members.length}`) + assert( + members[0].addresses[0].toLocaleLowerCase === + boClient.address.toLocaleLowerCase, + `Should be ${boClient.address} but was ${members[0].addresses[0]}` + ) + assert( + members[0].permissionLevel === "admin", + `Should be admin but was ${members[0].permissionLevel}` + ) + + return true +}) + test('can message in a group', async () => { // Create three MLS enabled Clients const [alixClient, boClient, caroClient] = await createClients(3)