From b9bc6a16a7badb89fa7b4a29bd5e1314aa4c5ba1 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Fri, 2 Jun 2023 12:04:48 -0700 Subject: [PATCH] try to decrease timeouts and add test for recently added can message --- .../xmtpreactnativesdk/example/EspressoViewFinder.kt | 4 ++-- example/src/tests.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/example/android/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/EspressoViewFinder.kt b/example/android/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/EspressoViewFinder.kt index c90219837..8ec87799d 100644 --- a/example/android/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/EspressoViewFinder.kt +++ b/example/android/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/EspressoViewFinder.kt @@ -15,8 +15,8 @@ import org.hamcrest.Matcher import java.util.concurrent.TimeoutException object EspressoViewFinder { - private const val CHECK_INTERVAL = 50L - private const val TIMEOUT_MS = 15 * 1000L + private const val CHECK_INTERVAL = 150L + private const val TIMEOUT_MS = 30 * 1000L /** * Waits for the view referenced in [viewMatcher] to become visible, with a timeout of [timeOut]. If it diff --git a/example/src/tests.ts b/example/src/tests.ts index 0252b7e3c..24b268eb0 100644 --- a/example/src/tests.ts +++ b/example/src/tests.ts @@ -48,10 +48,18 @@ test("can message a client", async () => { const messages = await aliceConversation.messages(); if (messages.length !== 1) { - throw "No message"; + throw Error("No message"); } const message = messages[0]; return message.content === "hello world"; }); + +test("canMessage", async () => { + const bob = await XMTP.Client.createRandom("local"); + const alice = await XMTP.Client.createRandom("local"); + + const canMessage = await bob.canMessage(alice.address); + return canMessage; +});