Skip to content

Commit

Permalink
fix up the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 4, 2024
1 parent 507ab07 commit fcb6e72
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 0 additions & 4 deletions example/src/tests/groupPerformanceTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
17 changes: 10 additions & 7 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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`
)

Expand Down Expand Up @@ -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}`)
}
Expand Down
1 change: 0 additions & 1 deletion src/lib/Dm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import * as XMTP from '../index'
export interface DmParams {
id: string
createdAt: number
creatorInboxId: InboxId
topic: string
consentState: ConsentState
lastMessage?: DecodedMessage
Expand Down
1 change: 0 additions & 1 deletion src/lib/types/GroupOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type GroupOptions = {
creatorInboxId?: boolean
isActive?: boolean
addedByInboxId?: boolean
name?: boolean
Expand Down

0 comments on commit fcb6e72

Please sign in to comment.