diff --git a/packages/opensrp-plans/src/components/MissionData/tests/index.test.tsx b/packages/opensrp-plans/src/components/MissionData/tests/index.test.tsx index bf57372d0..6a2300d1c 100644 --- a/packages/opensrp-plans/src/components/MissionData/tests/index.test.tsx +++ b/packages/opensrp-plans/src/components/MissionData/tests/index.test.tsx @@ -77,10 +77,7 @@ describe('mission data listing & download', () => { `"Mission dataService points visited: 13Products checked: 7Number of flagged products: 3Download mission data"` ); expect(wrapper.find('Button').text()).toEqual('Download mission data'); - // downloads mission data - expect(wrapper.find('a').at(0).props().href).toEqual( - 'https://opensrp-stage.smartregister.org/opensrp/rest/event/export-data?eventTypes=flag_problem,service_point_check,looks_good,record_gps&planIdentifier=335ef7a3-7f35-58aa-8263-4419464946d8' - ); + expect(fetch.mock.calls).toEqual([ [ 'https://opensrp-stage.smartregister.org/opensrp/rest/task/search?planIdentifier=335ef7a3-7f35-58aa-8263-4419464946d8&code=service_point_check&returnTaskCountOnly=true&status=Completed', diff --git a/packages/opensrp-plans/src/helpers/tests/utils.test.tsx b/packages/opensrp-plans/src/helpers/tests/utils.test.tsx index f72b4e644..451b22547 100644 --- a/packages/opensrp-plans/src/helpers/tests/utils.test.tsx +++ b/packages/opensrp-plans/src/helpers/tests/utils.test.tsx @@ -2,18 +2,12 @@ import { ACTIVE_PLANS_LIST_VIEW_URL, COMPLETE_PLANS_LIST_VIEW_URL, DRAFT_PLANS_LIST_VIEW_URL, - OPENSRP_API_BASE_URL, SORT_BY_EFFECTIVE_PERIOD_START_FIELD, RETIRED_PLANS_LIST_VIEW_URL, } from '../../constants'; import * as planDefinitionFixtures from '../../ducks/planDefinitions/tests/fixtures'; import { InterventionType, PlanDefinition, PlanStatus } from '@opensrp/plan-form-core'; -import { - descendingOrderSort, - isPlanDefinitionOfType, - getPlanType, - BuildDownloadUrl, -} from '../utils'; +import { descendingOrderSort, isPlanDefinitionOfType, getPlanType } from '../utils'; import { redirectPathGetter } from '../common'; describe('helpers/utils', () => { @@ -76,9 +70,4 @@ describe('helpers/utils', () => { expect(redirectPathGetter(PlanStatus.COMPLETE)).toEqual(COMPLETE_PLANS_LIST_VIEW_URL); expect(redirectPathGetter(PlanStatus.RETIRED)).toEqual(RETIRED_PLANS_LIST_VIEW_URL); }); - it('tests BuildDownloadUrl', () => { - expect(BuildDownloadUrl(OPENSRP_API_BASE_URL, '123')).toEqual( - 'https://opensrp-stage.smartregister.org/opensrp/rest/event/export-data?eventTypes=flag_problem,service_point_check,looks_good,record_gps&planIdentifier=123' - ); - }); });