mirror of
https://github.com/status-im/js-waku.git
synced 2025-02-23 18:38:11 +00:00
test: add delay for filter un/subscribe
This commit is contained in:
parent
0564c4f95c
commit
10c32c84c8
@ -46,6 +46,10 @@ describe("Waku Filter", () => {
|
||||
expect(msg.payloadAsUtf8).to.eq(messageText);
|
||||
};
|
||||
await waku.filter.subscribe(callback, [TestContentTopic]);
|
||||
// As the filter protocol does not cater for a ack of subscription
|
||||
// we cannot know whether the subscription happened. Something we want to
|
||||
// correct in future versions of the protocol.
|
||||
await delay(200);
|
||||
const message = await WakuMessage.fromUtf8String(
|
||||
messageText,
|
||||
TestContentTopic
|
||||
@ -66,6 +70,7 @@ describe("Waku Filter", () => {
|
||||
expect(msg.contentTopic).to.eq(TestContentTopic);
|
||||
};
|
||||
await waku.filter.subscribe(callback, [TestContentTopic]);
|
||||
await delay(200);
|
||||
await waku.lightPush.push(
|
||||
await WakuMessage.fromUtf8String("Filtering works!", TestContentTopic)
|
||||
);
|
||||
@ -89,6 +94,7 @@ describe("Waku Filter", () => {
|
||||
const unsubscribe = await waku.filter.subscribe(callback, [
|
||||
TestContentTopic,
|
||||
]);
|
||||
await delay(200);
|
||||
await waku.lightPush.push(
|
||||
await WakuMessage.fromUtf8String(
|
||||
"This should be received",
|
||||
@ -97,6 +103,7 @@ describe("Waku Filter", () => {
|
||||
);
|
||||
await delay(100);
|
||||
await unsubscribe();
|
||||
await delay(200);
|
||||
await waku.lightPush.push(
|
||||
await WakuMessage.fromUtf8String(
|
||||
"This should not be received",
|
||||
|
Loading…
x
Reference in New Issue
Block a user