From 605304cc8440f41db4588ce5bfc9b6fe317cae29 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Thu, 12 Dec 2024 12:00:54 -0800 Subject: [PATCH] fix content type tests, use v3 syncing --- example/src/tests/conversationTests.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/example/src/tests/conversationTests.ts b/example/src/tests/conversationTests.ts index 1515ae0a..716c9448 100644 --- a/example/src/tests/conversationTests.ts +++ b/example/src/tests/conversationTests.ts @@ -120,14 +120,15 @@ test('register and use custom content types', async () => { const bobConvo = await bob.conversations.newConversation(alice.address) await delayToPropogate() - const aliceConvo = await alice.conversations.newConversation(bob.address) - await bobConvo.send( { topNumber: { bottomNumber: 12 } }, { contentType: ContentTypeNumber } ) - const messages = await aliceConvo.messages() + await alice.conversations.syncAllConversations() + const aliceConvo = await alice.conversations.findConversation(bobConvo.id) + + const messages = await aliceConvo!.messages() assert(messages.length === 1, 'did not get messages') const message = messages[0] @@ -163,15 +164,19 @@ test('handle fallback types appropriately', async () => { bob.register(new NumberCodecEmptyFallback()) bob.register(new NumberCodecUndefinedFallback()) const bobConvo = await bob.conversations.newConversation(alice.address) - const aliceConvo = await alice.conversations.newConversation(bob.address) + // @ts-ignore await bobConvo.send(12, { contentType: ContentTypeNumberWithEmptyFallback }) + // @ts-ignore await bobConvo.send(12, { contentType: ContentTypeNumberWithUndefinedFallback, }) - const messages = await aliceConvo.messages() + await alice.conversations.syncAllConversations() + const aliceConvo = await alice.conversations.findConversation(bobConvo.id) + + const messages = await aliceConvo!.messages() assert(messages.length === 2, 'did not get messages') const messageUndefinedFallback = messages[0]