@@ -117,6 +117,13 @@ describe("grpc/server", () => {
117
117
// @ts -ignore
118
118
expect ( mockBindingReceive . mock . calls [ 0 ] [ 0 ] [ "hello" ] ) . toEqual ( "world" ) ;
119
119
} ) ;
120
+
121
+ it ( "should be able to send metadata to output binding successfully" , async ( ) => {
122
+ await server . client . binding . send ( "binding-redis" , "create" , "helloMessage" , { key : "helloKey" } ) ;
123
+
124
+ const res = await server . client . configuration . get ( "config-redis" , [ "helloKey" ] ) ;
125
+ expect ( res . items [ "helloKey" ] . value ) . toContain ( "helloMessage" ) ;
126
+ } ) ;
120
127
} ) ;
121
128
122
129
describe ( "pubsub" , ( ) => {
@@ -174,7 +181,7 @@ describe("grpc/server", () => {
174
181
}
175
182
} ) ;
176
183
177
- // TODO: uncomment these tests once metadata over gRPC is supported. See https://github.com/dapr/dapr/issues/2860
184
+ // TODO: uncomment these tests when https://github.com/dapr/dapr/issues/2860 is resolved.
178
185
// it('should be able to send cloud event and receive raw payload', async () => {
179
186
// const res = await server.client.pubsub.publish('pubsub-redis', 'test-topic-ce-raw', { hello: 'world-ce-raw' });
180
187
// expect(res).toEqual(true);
@@ -185,7 +192,7 @@ describe("grpc/server", () => {
185
192
186
193
// // Also test for receiving data
187
194
// // @ts -ignore
188
- // const rawData = mockPubSubSubscribeCloudEventRaw .mock.calls[0][0]['data_base64'];
195
+ // const rawData = mockPubSub .mock.calls[0][0]['data_base64'];
189
196
// const data = JSON.parse(Buffer.from(rawData, 'base64').toString());
190
197
// // @ts -ignore
191
198
// expect(data['data']['hello']).toEqual('world-ce-raw');
@@ -201,7 +208,7 @@ describe("grpc/server", () => {
201
208
202
209
// // Also test for receiving data
203
210
// // @ts -ignore
204
- // const rawData = mockPubSubSubscribeRawRaw .mock.calls[0][0]['data_base64'];
211
+ // const rawData = mockPubSub .mock.calls[0][0]['data_base64'];
205
212
// const data = JSON.parse(Buffer.from(rawData, 'base64').toString());
206
213
// // @ts -ignore
207
214
// expect(data['hello']).toEqual('world-raw-raw');
@@ -217,7 +224,7 @@ describe("grpc/server", () => {
217
224
218
225
// // Also test for receiving data
219
226
// // @ts -ignore
220
- // expect(mockPubSubSubscribeRawCloudEvent .mock.calls[0][0]['hello']).toEqual('world-raw-ce');
227
+ // expect(mockPubSub .mock.calls[0][0]['hello']).toEqual('world-raw-ce');
221
228
// })
222
229
223
230
it ( "should receive if it was successful or not" , async ( ) => {
0 commit comments