Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR consists of two major parts:
This PR also includes tests for the API endpoint, and a few other small fixes and adjustments (enumerated below)
Closes #XXX
Demo
Functioning app with network request:
![Screenshot 2024-07-12 at 10 40 56 AM](https://private-user-images.githubusercontent.com/38626218/348319116-7a29870f-37b5-4fc7-b8cc-9d9ed87c5489.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTQ1NTYsIm5iZiI6MTczODg1NDI1NiwicGF0aCI6Ii8zODYyNjIxOC8zNDgzMTkxMTYtN2EyOTg3MGYtMzdiNS00ZmM3LWI4Y2MtOWQ5ZWQ4N2M1NDg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE1MDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5N2JmMGVhY2Q4OTdlMzE1MjJhMzBkOGIxOWU4M2JjYWJjMjM5OTk2ZTI1MjRmNGQ2NzBkYzY3ZWRjZjBiMmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4M2obmB0Xzy43UUMNrdPc0-vDxEDRI6Tw3oiSXtPJ3A)
Displaying an error message:
![Screenshot 2024-07-12 at 10 41 33 AM](https://private-user-images.githubusercontent.com/38626218/348319123-ee9d83ba-2646-4941-b061-ff24ce4a8908.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTQ1NTYsIm5iZiI6MTczODg1NDI1NiwicGF0aCI6Ii8zODYyNjIxOC8zNDgzMTkxMjMtZWU5ZDgzYmEtMjY0Ni00OTQxLWIwNjEtZmYyNGNlNGE4OTA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE1MDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1NTRmYmFhMzViYmZjN2QyMWJjYmM1Yzg2N2M0YWI2YzhiODI5ZjU2ODYyY2VmZjkxZGEwZTM3ZDhhNDg4YzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yorw66iCUVh0xHK8waW28Nt-b3MScXsi-y43GI0KQUY)
Tests passing
![Screenshot 2024-07-12 at 10 42 45 AM](https://private-user-images.githubusercontent.com/38626218/348319127-f0e7733c-c5ac-4159-9f46-936f3b220402.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTQ1NTYsIm5iZiI6MTczODg1NDI1NiwicGF0aCI6Ii8zODYyNjIxOC8zNDgzMTkxMjctZjBlNzczM2MtYzVhYy00MTU5LTlmNDYtOTM2ZjNiMjIwNDAyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE1MDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2NGQ3OGMwZDcxYTk5ZDExM2I2MzE4MzBhZjEyZGI1N2JhNjQ5OGU4YjRhZDU5NWEwOWIwMmEzZDM5MjhmYTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NqVZmBMsQ2FLQ4P1LuRr9xKnjuP01K40ympT75Y3840)
Notes
Other changes:
npm
to theapt-get...
line in the Dockerfile, to fix annpm not found
error when buildingdisplay: none
styling on the address results div to use Bootstrap'sd-none
utility class. This maintains consistency with the rest of the page's styling, and makes manipulating the div's styling through JavaScript more straightforward.Testing Instructions
How to Test
New Test Cases
test_api_parse_succeeds
-- The API should respond successfully, with expected JSON, on a valid addresstest_api_parse_succeeds_on_empty_string
-- the API should respond successfully on an empty string, consistent with the output ofusaddress
and expected frontend behaviortest_api_parse_raises_error
-- The API should raise an error on an invalid address inputtest_api_parse_raises_error_on_missing_address_string
-- The API should raise an error when missing address input (from a malformed request, e.g.)