Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix group members test #403

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading