From 15e454e4de9408f90faabc4751f9c76cbc13d068 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 6 Feb 2025 18:19:47 -0800 Subject: [PATCH] get the tests passing --- .../expo/modules/xmtpreactnativesdk/XMTPModule.kt | 5 +++++ example/src/tests/conversationTests.ts | 14 +++++++------- example/src/tests/groupPermissionsTests.ts | 2 +- example/src/tests/groupTests.ts | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt index 6e24eea5..72166377 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -176,6 +176,11 @@ class XMTPModule : Module() { a.apply { set(i, v.toByte()) } } val historySyncUrl = authOptions.historySyncUrl + ?: when (authOptions.environment) { + "production" -> "https://message-history.production.ephemera.network/" + "local" -> "http://10.0.2.2:5558" + else -> "https://message-history.dev.ephemera.network/" + } return ClientOptions( api = apiEnvironments(authOptions.environment, authOptions.appVersion), preAuthenticateToInboxCallback = preAuthenticateToInboxCallback, diff --git a/example/src/tests/conversationTests.ts b/example/src/tests/conversationTests.ts index 7f7c1fa0..f078bcc1 100644 --- a/example/src/tests/conversationTests.ts +++ b/example/src/tests/conversationTests.ts @@ -467,19 +467,19 @@ test('can filter sync all by consent', async () => { const boConvosFilteredAllowedOrDenied = await boClient.conversations.syncAllConversations(['allowed', 'denied']) - assert(boConvos === 4, `Conversation length should be 4 but was ${boConvos}`) + assert(boConvos === 5, `Conversation length should be 5 but was ${boConvos}`) assert( - boConvosFilteredAllowed === 2, - `Conversation length should be 2 but was ${boConvosFilteredAllowed}` + boConvosFilteredAllowed === 3, + `Conversation length should be 3 but was ${boConvosFilteredAllowed}` ) assert( - boConvosFilteredUnknown === 1, - `Conversation length should be 1 but was ${boConvosFilteredUnknown}` + boConvosFilteredUnknown === 2, + `Conversation length should be 2 but was ${boConvosFilteredUnknown}` ) assert( - boConvosFilteredAllowedOrDenied === 3, - `Conversation length should be 3 but was ${boConvosFilteredAllowedOrDenied}` + boConvosFilteredAllowedOrDenied === 4, + `Conversation length should be 4 but was ${boConvosFilteredAllowedOrDenied}` ) return true diff --git a/example/src/tests/groupPermissionsTests.ts b/example/src/tests/groupPermissionsTests.ts index 89fd1da3..369b9f5a 100644 --- a/example/src/tests/groupPermissionsTests.ts +++ b/example/src/tests/groupPermissionsTests.ts @@ -560,7 +560,7 @@ test('creating a group with invalid permissions should fail', async () => { updateGroupNamePolicy: 'admin', updateGroupDescriptionPolicy: 'allow', updateGroupImagePolicy: 'admin', - updateMessageExpirationPolicy: 'admin', + updateMessageDisappearingPolicy: 'admin', } // Bo creates a group with Alix and Caro diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index d75c64eb..db600876 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -1142,8 +1142,8 @@ test('can list groups with params', async () => { `List length should be 1 but was ${boGroupsLimit.length}` ) assert( - boGroupsLimit[0].id === boGroup1.id, - `Group should be ${boGroup1.id} but was ${boGroupsLimit[0].id}` + boGroupsLimit[0].id === boGroup2.id, + `Group should be ${boGroup2.id} but was ${boGroupsLimit[0].id}` ) return true