Skip to content

Commit

Permalink
Merge pull request #403 from xmtp/cv/fix-members-test
Browse files Browse the repository at this point in the history
Fix group members test
  • Loading branch information
cameronvoell authored Jun 3, 2024
2 parents 4ba132d + 9d52597 commit c5a9864
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -769,4 +769,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2

COCOAPODS: 1.14.2
COCOAPODS: 1.15.2
32 changes: 23 additions & 9 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,30 @@ test('can get members of a group', async () => {
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}`
)

// We can not be sure of the order that members will be returned in
for (const member of members) {
// Alix created the group so they are a super admin
if (
member.addresses[0].toLocaleLowerCase() ===
alixClient.address.toLocaleLowerCase()
) {
assert(
member.permissionLevel === 'super_admin',
`Should be super_admin but was ${member.permissionLevel}`
)
}
// Bo did not create the group so he defaults to permission level "member"
if (
member.addresses[0].toLocaleLowerCase() ===
boClient.address.toLocaleLowerCase()
) {
assert(
member.permissionLevel === 'member',
`Should be member but was ${member.permissionLevel}`
)
}
}
return true
})

Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@ export async function isInboxDenied(
return XMTPModule.isInboxDenied(clientAddress, inboxId)
}


export async function processGroupMessage<
ContentTypes extends DefaultContentTypes = DefaultContentTypes,
>(
Expand Down

0 comments on commit c5a9864

Please sign in to comment.