@@ -489,4 +489,120 @@ describe('Management OutboundApplication', () => {
489489 } ) ;
490490 } ) ;
491491 } ) ;
492+
493+ describe ( 'deleteUserTokens' , ( ) => {
494+ it ( 'should send the correct request with both appId and userId' , async ( ) => {
495+ const httpResponse = {
496+ ok : true ,
497+ json : ( ) => ( { } ) ,
498+ clone : ( ) => ( {
499+ json : ( ) => Promise . resolve ( { } ) ,
500+ } ) ,
501+ status : 200 ,
502+ } ;
503+ mockHttpClient . delete . mockResolvedValue ( httpResponse ) ;
504+
505+ const resp = await management . outboundApplication . deleteUserTokens ( 'app123' , 'user456' ) ;
506+
507+ expect ( mockHttpClient . delete ) . toHaveBeenCalledWith (
508+ apiPaths . outboundApplication . deleteUserTokens ,
509+ {
510+ queryParams : { appId : 'app123' , userId : 'user456' } ,
511+ } ,
512+ ) ;
513+
514+ expect ( resp ) . toEqual ( {
515+ code : 200 ,
516+ data : { } ,
517+ ok : true ,
518+ response : httpResponse ,
519+ } ) ;
520+ } ) ;
521+
522+ it ( 'should work with only appId' , async ( ) => {
523+ const httpResponse = {
524+ ok : true ,
525+ json : ( ) => ( { } ) ,
526+ clone : ( ) => ( {
527+ json : ( ) => Promise . resolve ( { } ) ,
528+ } ) ,
529+ status : 200 ,
530+ } ;
531+ mockHttpClient . delete . mockResolvedValue ( httpResponse ) ;
532+
533+ const resp = await management . outboundApplication . deleteUserTokens ( 'app123' ) ;
534+
535+ expect ( mockHttpClient . delete ) . toHaveBeenCalledWith (
536+ apiPaths . outboundApplication . deleteUserTokens ,
537+ {
538+ queryParams : { appId : 'app123' , userId : undefined } ,
539+ } ,
540+ ) ;
541+
542+ expect ( resp ) . toEqual ( {
543+ code : 200 ,
544+ data : { } ,
545+ ok : true ,
546+ response : httpResponse ,
547+ } ) ;
548+ } ) ;
549+
550+ it ( 'should work with only userId' , async ( ) => {
551+ const httpResponse = {
552+ ok : true ,
553+ json : ( ) => ( { } ) ,
554+ clone : ( ) => ( {
555+ json : ( ) => Promise . resolve ( { } ) ,
556+ } ) ,
557+ status : 200 ,
558+ } ;
559+ mockHttpClient . delete . mockResolvedValue ( httpResponse ) ;
560+
561+ const resp = await management . outboundApplication . deleteUserTokens ( undefined , 'user456' ) ;
562+
563+ expect ( mockHttpClient . delete ) . toHaveBeenCalledWith (
564+ apiPaths . outboundApplication . deleteUserTokens ,
565+ {
566+ queryParams : { appId : undefined , userId : 'user456' } ,
567+ } ,
568+ ) ;
569+
570+ expect ( resp ) . toEqual ( {
571+ code : 200 ,
572+ data : { } ,
573+ ok : true ,
574+ response : httpResponse ,
575+ } ) ;
576+ } ) ;
577+ } ) ;
578+
579+ describe ( 'deleteTokenById' , ( ) => {
580+ it ( 'should send the correct request and receive correct response' , async ( ) => {
581+ const httpResponse = {
582+ ok : true ,
583+ json : ( ) => ( { } ) ,
584+ clone : ( ) => ( {
585+ json : ( ) => Promise . resolve ( { } ) ,
586+ } ) ,
587+ status : 200 ,
588+ } ;
589+ mockHttpClient . delete . mockResolvedValue ( httpResponse ) ;
590+
591+ const resp = await management . outboundApplication . deleteTokenById ( 'token123' ) ;
592+
593+ expect ( mockHttpClient . delete ) . toHaveBeenCalledWith (
594+ apiPaths . outboundApplication . deleteTokenById ,
595+ {
596+ queryParams : { id : 'token123' } ,
597+ } ,
598+ ) ;
599+
600+ expect ( resp ) . toEqual ( {
601+ code : 200 ,
602+ data : { } ,
603+ ok : true ,
604+ response : httpResponse ,
605+ } ) ;
606+ } ) ;
607+ } ) ;
492608} ) ;
0 commit comments