@@ -532,6 +532,32 @@ describe('RoutingConfigClient', () => {
532532 } ) ;
533533 } ) ;
534534
535+ test ( 'returns failures from client config repository' , async ( ) => {
536+ const { client, mocks } = setup ( ) ;
537+
538+ mocks . clientConfigRepository . get . mockResolvedValueOnce ( {
539+ error : {
540+ errorMeta : {
541+ code : 500 ,
542+ description : 'could not fetch client config' ,
543+ } ,
544+ } ,
545+ } ) ;
546+
547+ const result = await client . submitRoutingConfig ( 'some-id' , user ) ;
548+
549+ expect ( mocks . routingConfigRepository . submit ) . not . toHaveBeenCalled ( ) ;
550+
551+ expect ( result ) . toEqual ( {
552+ error : {
553+ errorMeta : {
554+ code : 500 ,
555+ description : 'could not fetch client config' ,
556+ } ,
557+ } ,
558+ } ) ;
559+ } ) ;
560+
535561 test ( 'returns failure if routing feature is disabled for the client' , async ( ) => {
536562 const { client, mocks } = setup ( ) ;
537563
@@ -610,6 +636,32 @@ describe('RoutingConfigClient', () => {
610636 expect ( result ) . toEqual ( errorResponse ) ;
611637 } ) ;
612638
639+ test ( 'returns failures from client config repository' , async ( ) => {
640+ const { client, mocks } = setup ( ) ;
641+
642+ mocks . clientConfigRepository . get . mockResolvedValueOnce ( {
643+ error : {
644+ errorMeta : {
645+ code : 500 ,
646+ description : 'could not fetch client config' ,
647+ } ,
648+ } ,
649+ } ) ;
650+
651+ const result = await client . deleteRoutingConfig ( 'some-id' , user ) ;
652+
653+ expect ( mocks . routingConfigRepository . delete ) . not . toHaveBeenCalled ( ) ;
654+
655+ expect ( result ) . toEqual ( {
656+ error : {
657+ errorMeta : {
658+ code : 500 ,
659+ description : 'could not fetch client config' ,
660+ } ,
661+ } ,
662+ } ) ;
663+ } ) ;
664+
613665 test ( 'returns failure if routing feature is disabled for the client' , async ( ) => {
614666 const { client, mocks } = setup ( ) ;
615667
0 commit comments