Skip to content

Commit

Permalink
write a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 10, 2024
1 parent e413cd9 commit 08d2efb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.xmtp.android.library.Client

class ClientWrapper {
companion object {
fun encodeToObj(client: Client): Map<String, Any> {
fun encodeToObj(client: Client): Map<String, String> {
return mapOf(
"inboxId" to client.inboxId,
"address" to client.address,
Expand Down
10 changes: 10 additions & 0 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ test('can make a MLS V3 client from bundle', async () => {
`clients dont match ${client2.address} and ${client.address}`
)

assert(
client.inboxId === client2.inboxId,
`clients dont match ${client2.inboxId} and ${client.inboxId}`
)

assert(
client.installationId === client2.installationId,
`clients dont match ${client2.installationId} and ${client.installationId}`
)

const randomClient = await Client.createRandom({
env: 'local',
appVersion: 'Testing/0.0.0',
Expand Down
2 changes: 1 addition & 1 deletion ios/Wrappers/ClientWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import XMTP

// Wrapper around XMTP.Client to allow passing these objects back into react native.
struct ClientWrapper {
static func encodeToObj(_ client: XMTP.Client) throws -> [String: Any] {
static func encodeToObj(_ client: XMTP.Client) throws -> [String: String] {
return [
"inboxId": client.inboxID,
"address": client.address,
Expand Down

0 comments on commit 08d2efb

Please sign in to comment.