This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
forked from HHS/simpler-grants-gov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { ApiResponse } from "../../src/types/opportunity/opportunityResponseTypes"; | ||
import OpportunityListingAPI from "../../src/app/api/OpportunityListingAPI"; | ||
import { OpportunityApiResponse } from "src/types/opportunity/opportunityResponseTypes"; | ||
import OpportunityListingAPI from "src/app/api/OpportunityListingAPI"; | ||
|
||
jest.mock("src/app/api/BaseApi"); | ||
|
||
|
@@ -16,7 +16,7 @@ describe("OpportunityListingAPI", () => { | |
}); | ||
|
||
it("should return opportunity data for a valid ID", async () => { | ||
const mockResponse: ApiResponse = getValidMockResponse(); | ||
const mockResponse: OpportunityApiResponse = getValidMockResponse(); | ||
|
||
mockedRequest.mockResolvedValue(mockResponse); | ||
|
||
|
@@ -43,61 +43,59 @@ describe("OpportunityListingAPI", () => { | |
|
||
function getValidMockResponse() { | ||
return { | ||
data: [ | ||
{ | ||
agency: "US-ABC", | ||
category: "discretionary", | ||
category_explanation: null, | ||
created_at: "2024-06-20T18:43:04.555Z", | ||
opportunity_assistance_listings: [ | ||
{ | ||
assistance_listing_number: "43.012", | ||
program_title: "Space Technology", | ||
}, | ||
], | ||
opportunity_id: 12345, | ||
opportunity_number: "ABC-123-XYZ-001", | ||
opportunity_status: "posted", | ||
opportunity_title: "Research into conservation techniques", | ||
summary: { | ||
additional_info_url: "grants.gov", | ||
additional_info_url_description: "Click me for more info", | ||
agency_code: "US-ABC", | ||
agency_contact_description: | ||
"For more information, reach out to Jane Smith at agency US-ABC", | ||
agency_email_address: "[email protected]", | ||
agency_email_address_description: "Click me to email the agency", | ||
agency_name: "US Alphabetical Basic Corp", | ||
agency_phone_number: "123-456-7890", | ||
applicant_eligibility_description: | ||
"All types of domestic applicants are eligible to apply", | ||
applicant_types: ["state_governments"], | ||
archive_date: "2024-06-20", | ||
award_ceiling: 100000, | ||
award_floor: 10000, | ||
close_date: "2024-06-20", | ||
close_date_description: "Proposals are due earlier than usual.", | ||
estimated_total_program_funding: 10000000, | ||
expected_number_of_awards: 10, | ||
fiscal_year: 0, | ||
forecasted_award_date: "2024-06-20", | ||
forecasted_close_date: "2024-06-20", | ||
forecasted_close_date_description: | ||
"Proposals will probably be due on this date", | ||
forecasted_post_date: "2024-06-20", | ||
forecasted_project_start_date: "2024-06-20", | ||
funding_categories: ["recovery_act"], | ||
funding_category_description: "Economic Support", | ||
funding_instruments: ["cooperative_agreement"], | ||
is_cost_sharing: true, | ||
is_forecast: false, | ||
post_date: "2024-06-20", | ||
summary_description: | ||
"This opportunity aims to unravel the mysteries of the universe.", | ||
data: { | ||
agency: "US-ABC", | ||
category: "discretionary", | ||
category_explanation: null, | ||
created_at: "2024-06-20T18:43:04.555Z", | ||
opportunity_assistance_listings: [ | ||
{ | ||
assistance_listing_number: "43.012", | ||
program_title: "Space Technology", | ||
}, | ||
updated_at: "2024-06-20T18:43:04.555Z", | ||
], | ||
opportunity_id: 12345, | ||
opportunity_number: "ABC-123-XYZ-001", | ||
opportunity_status: "posted", | ||
opportunity_title: "Research into conservation techniques", | ||
summary: { | ||
additional_info_url: "grants.gov", | ||
additional_info_url_description: "Click me for more info", | ||
agency_code: "US-ABC", | ||
agency_contact_description: | ||
"For more information, reach out to Jane Smith at agency US-ABC", | ||
agency_email_address: "[email protected]", | ||
agency_email_address_description: "Click me to email the agency", | ||
agency_name: "US Alphabetical Basic Corp", | ||
agency_phone_number: "123-456-7890", | ||
applicant_eligibility_description: | ||
"All types of domestic applicants are eligible to apply", | ||
applicant_types: ["state_governments"], | ||
archive_date: "2024-06-20", | ||
award_ceiling: 100000, | ||
award_floor: 10000, | ||
close_date: "2024-06-20", | ||
close_date_description: "Proposals are due earlier than usual.", | ||
estimated_total_program_funding: 10000000, | ||
expected_number_of_awards: 10, | ||
fiscal_year: 0, | ||
forecasted_award_date: "2024-06-20", | ||
forecasted_close_date: "2024-06-20", | ||
forecasted_close_date_description: | ||
"Proposals will probably be due on this date", | ||
forecasted_post_date: "2024-06-20", | ||
forecasted_project_start_date: "2024-06-20", | ||
funding_categories: ["recovery_act"], | ||
funding_category_description: "Economic Support", | ||
funding_instruments: ["cooperative_agreement"], | ||
is_cost_sharing: true, | ||
is_forecast: false, | ||
post_date: "2024-06-20", | ||
summary_description: | ||
"This opportunity aims to unravel the mysteries of the universe.", | ||
}, | ||
], | ||
updated_at: "2024-06-20T18:43:04.555Z", | ||
}, | ||
message: "Success", | ||
status_code: 200, | ||
}; | ||
|