@@ -2,13 +2,21 @@ const nock = require("nock");
22const { getHomeOrgRetirementActivities } = require ( "../src/api/retirement-explorer" ) ;
33const { CONFIG } = require ( "../src/config" ) ;
44const { generateUriForHostAndPort } = require ( "../src/utils" ) ;
5+ const HomeOrgMock = require ( "./data/HomeOrgMock" ) ;
6+ const OrganizationsMock = require ( "./data/OrganizationsMock" ) ;
57
68const retirementExplorerUri = generateUriForHostAndPort (
79 CONFIG ( ) . RETIREMENT_EXPLORER . PROTOCOL ,
810 CONFIG ( ) . RETIREMENT_EXPLORER . HOST ,
911 CONFIG ( ) . RETIREMENT_EXPLORER . PORT
1012) ;
1113
14+ const registryUri = generateUriForHostAndPort (
15+ CONFIG ( ) . CADT . PROTOCOL ,
16+ CONFIG ( ) . CADT . HOST ,
17+ CONFIG ( ) . CADT . PORT
18+ ) ;
19+
1220describe ( "getHomeOrgRetirementActivities" , ( ) => {
1321 const apiEndpoint = retirementExplorerUri ;
1422 const mockResponse = {
@@ -21,8 +29,10 @@ describe("getHomeOrgRetirementActivities", () => {
2129 beforeEach ( ( ) => {
2230 nock ( apiEndpoint )
2331 . get ( "/v1/activities" )
24- . query ( { page : 1 , limit : 10 , org_uid : "a9d374baa8ced8b7a4add2a23f35f430fd7a3c99d1480d762e0b40572db4b024" , minHeight : 1 , sort : "asc" } )
32+ . query ( { page : 1 , limit : 10 , org_uid : HomeOrgMock . orgUid , minHeight : 1 , sort : "asc" } )
2533 . reply ( 200 , mockResponse ) ;
34+
35+ nock ( registryUri ) . get ( "/v1/organizations" ) . reply ( 200 , OrganizationsMock ) ;
2636 } ) ;
2737
2838 it ( 'should filter out activities that do not have a mode of "PERMISSIONLESS_RETIREMENT"' , async ( ) => {
0 commit comments