@@ -1105,6 +1105,47 @@ describe('AppClient tests', () => {
11051105 } ) ;
11061106 } ) ;
11071107
1108+ describe ( 'listMachineSummaries tests' , ( ) => {
1109+ const locSummary1 = new pb . LocationSummary ( { } ) ;
1110+ const locSummary2 = new pb . LocationSummary ( { } ) ;
1111+ const locationSummaries = [ locSummary1 , locSummary2 ] ;
1112+ let capturedReq : pb . ListMachineSummariesRequest | undefined ;
1113+
1114+ beforeEach ( ( ) => {
1115+ mockTransport = createRouterTransport ( ( { service } ) => {
1116+ service ( AppService , {
1117+ listMachineSummaries : ( req : pb . ListMachineSummariesRequest ) => {
1118+ capturedReq = req ;
1119+ return new pb . ListMachineSummariesResponse ( { locationSummaries } ) ;
1120+ } ,
1121+ } ) ;
1122+ } ) ;
1123+ } ) ;
1124+
1125+ it ( 'returns location summaries with only organizationId' , async ( ) => {
1126+ const response = await subject ( ) . listMachineSummaries ( 'orgId' ) ;
1127+ expect ( response ) . toEqual ( locationSummaries ) ;
1128+ expect ( capturedReq ?. organizationId ) . toEqual ( 'orgId' ) ;
1129+ expect ( capturedReq ?. fragmentIds ) . toEqual ( [ ] ) ;
1130+ expect ( capturedReq ?. locationIds ) . toEqual ( [ ] ) ;
1131+ expect ( capturedReq ?. limit ) . toBeUndefined ( ) ;
1132+ } ) ;
1133+
1134+ it ( 'returns location summaries with all filters' , async ( ) => {
1135+ const response = await subject ( ) . listMachineSummaries (
1136+ 'orgId' ,
1137+ [ 'frag1' , 'frag2' ] ,
1138+ [ 'loc1' ] ,
1139+ 5
1140+ ) ;
1141+ expect ( response ) . toEqual ( locationSummaries ) ;
1142+ expect ( capturedReq ?. organizationId ) . toEqual ( 'orgId' ) ;
1143+ expect ( capturedReq ?. fragmentIds ) . toEqual ( [ 'frag1' , 'frag2' ] ) ;
1144+ expect ( capturedReq ?. locationIds ) . toEqual ( [ 'loc1' ] ) ;
1145+ expect ( capturedReq ?. limit ) . toEqual ( 5 ) ;
1146+ } ) ;
1147+ } ) ;
1148+
11081149 describe ( 'newRobot tests' , ( ) => {
11091150 beforeEach ( ( ) => {
11101151 mockTransport = createRouterTransport ( ( { service } ) => {
0 commit comments