Skip to content

Commit

Permalink
fix up test
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Feb 8, 2025
1 parent 59d783a commit b4a1c04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion example/src/tests/groupPermissionsTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ test('can create a group with custom permissions', async () => {
}

// Bo creates a group with Alix and Caro with custom permissions
const boGroup = await bo.conversations.newGroupCustomPermissions(
await bo.conversations.newGroupCustomPermissions(
[alix.address, caro.address],
customPermissionsPolicySet
)
Expand Down
16 changes: 8 additions & 8 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,14 +707,6 @@ test('unpublished messages handling', async () => {
// Prepare a message in the group
const preparedMessageId = await alixGroup.prepareMessage('Test text')

// Check if the group is allowed after preparing the message
const isGroupAllowed = await alixClient.preferences.conversationConsentState(
boGroup.id
)
if (isGroupAllowed !== 'allowed') {
throw new Error('Group should be allowed after preparing a message')
}

// Verify the message count in the group
let messageCount = (await alixGroup.messages()).length
if (messageCount !== 1) {
Expand All @@ -731,6 +723,14 @@ test('unpublished messages handling', async () => {
throw new Error(`Message count should be 1, but it is ${messageCount}`)
}

// Check if the group is allowed after preparing the message
const isGroupAllowed = await alixClient.preferences.conversationConsentState(
boGroup.id
)
if (isGroupAllowed !== 'allowed') {
throw new Error('Group should be allowed after preparing a message')
}

// Retrieve all messages and verify the prepared message ID
const messages = await alixGroup.messages()
if (preparedMessageId !== messages[0].id) {
Expand Down

0 comments on commit b4a1c04

Please sign in to comment.