Skip to content

Commit

Permalink
write a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 3, 2024
1 parent 3e4aea4 commit 050a773
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Check warning on line 255 in example/src/tests/groupTests.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `"admin"` with `'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)
Expand Down

0 comments on commit 050a773

Please sign in to comment.