From 953bda781f7838198662a0356f467cf5e4c6857d Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 11:12:06 +1000 Subject: [PATCH] test: Ensure pubsub topic is used when sending and retrieving messages --- src/lib/waku_light_push/index.node.spec.ts | 1 + src/test_utils/nwaku.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/waku_light_push/index.node.spec.ts b/src/lib/waku_light_push/index.node.spec.ts index 486fe3b830..2a032f767d 100644 --- a/src/lib/waku_light_push/index.node.spec.ts +++ b/src/lib/waku_light_push/index.node.spec.ts @@ -82,6 +82,7 @@ describe("Waku Light Push [node only]", () => { dbg("Send message via lightpush"); const pushResponse = await waku.lightPush.push(message, { peerId: nimPeerId, + pubSubTopic: customPubSubTopic, }); dbg("Ack received", pushResponse); expect(pushResponse?.isSuccess).to.be.true; diff --git a/src/test_utils/nwaku.ts b/src/test_utils/nwaku.ts index 22f8a105b2..3b9b9dabdf 100644 --- a/src/test_utils/nwaku.ts +++ b/src/test_utils/nwaku.ts @@ -217,7 +217,9 @@ export class Nwaku { ]); } - async messages(pubsubTopic?: string): Promise { + async messages( + pubsubTopic: string = DefaultPubSubTopic + ): Promise { this.checkProcess(); const isDefined = (msg: WakuMessage | undefined): msg is WakuMessage => { @@ -226,7 +228,7 @@ export class Nwaku { const protoMsgs = await this.rpcCall( "get_waku_v2_relay_v1_messages", - [pubsubTopic ?? DefaultPubSubTopic] + [pubsubTopic] ); const msgs = await Promise.all(