diff --git a/packages/sdk/src/subscribe/subscription-manager.test.ts b/packages/sdk/src/subscribe/subscription-manager.test.ts index 4425992f4..12d830422 100644 --- a/packages/sdk/src/subscribe/subscription-manager.test.ts +++ b/packages/sdk/src/subscribe/subscription-manager.test.ts @@ -52,4 +52,18 @@ describe("SubscriptionManager", () => { }) expect(mockSubscriptionTransport.subscribe.mock.results[0].value.unsubscribe).toHaveBeenCalledTimes(1) }) + + test("receives decoded data from subscription", async () => { + const topic = "topic" + const args = {foo: "bar"} + const onData = jest.fn() + const onError = jest.fn() + + const sub = manager.subscribe({topic, args, onData, onError}) + const onDataCallback = mockSubscriptionTransport.subscribe.mock.calls[0][0].onData + onDataCallback("data") + + expect(onData).toHaveBeenCalledTimes(1) + expect(onData).toHaveBeenCalledWith("data") + }) }) \ No newline at end of file