@@ -291,9 +291,7 @@ describe('grpc/main', () => {
291
291
expect ( config . items . filter ( i => i . key == "myconfigkey3" ) [ 0 ] . value ) . toEqual ( "key3_initialvalue" ) ;
292
292
} ) ;
293
293
294
- // OK (temp)
295
294
it ( 'should be able to get the configuration items with metadata' , async ( ) => {
296
- // await server.configuration.subscribe();
297
295
await client . configuration . get ( "config-redis" , [ "myconfigkey1" ] , { "hello" : "world" } ) ;
298
296
299
297
// Disabled for now as I am unsure if Dapr returns the metadata items
@@ -327,6 +325,17 @@ describe('grpc/main', () => {
327
325
expect ( m . mock . calls [ 0 ] [ 0 ] . items [ 0 ] . value ) . toEqual ( "key1_mynewvalue" ) ;
328
326
} ) ;
329
327
328
+ it ( 'should be able to subscribe with metadata' , async ( ) => {
329
+ const m = jest . fn ( async ( _res : SubscribeConfigurationResponse ) => { return ; } ) ;
330
+
331
+ await client . configuration . subscribeWithMetadata ( "config-redis" , [ "myconfigkey1" , "myconfigkey2" ] , { "hello" : "world" } , m ) ;
332
+ await DockerUtils . executeDockerCommand ( "dapr_redis redis-cli MSET myconfigkey1 key1_mynewvalue||1" ) ;
333
+
334
+ expect ( m . mock . calls . length ) . toEqual ( 1 ) ;
335
+ expect ( m . mock . calls [ 0 ] [ 0 ] . items [ 0 ] . key ) . toEqual ( "myconfigkey1" ) ;
336
+ expect ( m . mock . calls [ 0 ] [ 0 ] . items [ 0 ] . value ) . toEqual ( "key1_mynewvalue" ) ;
337
+ } ) ;
338
+
330
339
it ( 'should be able to subscribe to configuration items through multiple streams' , async ( ) => {
331
340
const m1 = jest . fn ( async ( _res : SubscribeConfigurationResponse ) => { return ; } ) ;
332
341
const m2 = jest . fn ( async ( _res : SubscribeConfigurationResponse ) => { return ; } ) ;
0 commit comments